Unity/Asset 분석 37

[RTS Engine] 유닛이 제대로 작동하지 않을 때 체크리스트

1. 전체적 관점에서의 설정 게임시스템 상에 유닛으로 잡혀있어야 한다. 아래 두가지 경우 중 하나여야 한다 ① GameManager의 Fraction에 들어있는 경우 ② UnitSpawner에 의해 생성되는 경우 2. 각 유닛 관점에서의 설정 UnitComponent에서 누락된 것이 없는지 확인 - Model - Fraction Colored Renderers 펼쳐서 확인 각 유닛 설정의 경우, Sample로 제작되어 있는 Unit Prefab과 비교해가면서 원인 찾도록 할 것

Unity/Asset 분석 2021.06.12

게임 일시정지하기

Time.timescale을 이용하여 정지하는 방법 Time.timescale? 시간이 경과하는 크기를 나타냅니다. 슬로우 모션 효과에 사용될 수 있습니다. /timeScale/이 1.0인 경우에, 실제 시간과 같은 속도로 경과합니다. /timeScale/이 0.5인 경우에, 실제 시간과 비교해서 2배 느리게 경과합니다. /timeScale/이 0으로 설정되는 경우에, 일반적으로 프레임비율(framerate)과 독립적으로, 모든 기능을 일시정지 합니다. public void TogglePauseMenu () { if (GameManager.GameState == GameState.running) GameManager.SetGameState(GameState.pause); else if (GameManag..

Unity/Asset 분석 2021.06.11

[RTS Engine] 더블탭으로 SelectionBox 그리기

기존 코드를 Mobile에 맞게 수정. 더블탭을 이용하여 SelectionBox를 그리도록 한다. SelectionBox.cs 를 수정. 로그를 보면.. 마우스를 누르고 있는 동안 OnDrawingProgress()가 계속해서 호출 마우스를 떼면 OnDrawingComplete()가 한번 호출된다. 기존 코드에서 #UNITY_ANDROID에서 터치를 받은 후 CatchTouchInput() 매소드에서 모바일 터치 입력을 처리. using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using UnityEngine.EventSystems; namespace RTSEngine { [S..

Unity/Asset 분석 2021.06.08

[RTS Engine] 공격 사거리

당연히 있어야 될 것 같은 사정거리라는 변수가 없어서 어떤 구조인지 파악하기가 힘들었다. ① 상대편 유닛을 공격할때 사정거리를 설정하는 경우 (Unit Stopping Distance) Unit Stop Distance 값을 조정 Unit/Building Stopping Distance: When moving towards a target unit/building, this field is the minimum and maximum allowed stopping distance value for that movement. 일단 Max가 사정거리. 코드 보면.. (min=true) Max거리 밖에서 적을 마우스로 직접 찍으면 Min 거리에 가서 쏨 (min=false) 이외에는 Max거리까지 가서 쏘거나 ..

Unity/Asset 분석 2021.06.04

[RTS Engine] AttackObject의 Mesh가 재생성 되지 않을 때

캐터펄트로 실험을 했는데, 첫 1회만 돌이 날아가고 그다음부터는 Particle Effect만 보이고 돌은 안날아감. 날아가는 물체는 Effect Obj, Attack Object 컴포넌트를 가져야 함. Effect Obj Pool 구성 요소는 맵에서 효과 및 공격 오브젝트에 대한 Pool 역할을합니다. RTS Engine 메뉴 편집기를 사용하여 새지도를 만들 때이 구성 요소는 "AttackManager"라는 개체에 연결됩니다. Code: Make sure that every effect object has a unique code so that the effect object pool can distinguish between different effect objects. Enable Life Time..

Unity/Asset 분석 2021.06.02

[RTS Engine] 유닛 공격(Attack)

투석기(Catapult)의 경우, 아래 경로에 유닛 정보가 있음. ① 유닛에다가 Unit Attack 컴포넌트를 넣는다. ② Sources에 날아가는 물체를 넣는다. ③ 날아가는 물체가 되려면, Attact Object 컴포넌트를 넣는다. ④ Hit Effect는 충돌시의 특수효과 ⑤ 특수효과과 되려면 Effect Obj가 있어야 함. 유닛에 들어있는 Unit Ragdoll Effect 공격을 하지 않을 때 CheckList ① Peace Time 확인 ② Unit Attack 컴포넌트의 Source에서 AttackObjSource를 확인

Unity/Asset 분석 2021.05.31

[RTS Engine] 편(Faction) 설정하기

이 에셋에서 Faction이라는 개념으로 편을 나눈다. (파벌이라는 뜻) ① Faction에 대한 전체적인 설정은 GameManager에서 함 ② Add 누를때마다 Element가 하나씩 생김 ③ 초기유닛을 설정 Game Manager The Game Manager is the component that handles the faction initialization in the map and some other general settings for the game. This is the main script that connects each component with each other. When creating a new map using the RTS Engine menu, thi soumidelri..

Unity/Asset 분석 2021.05.31

[Dynamic Water Physics] Lux Water에 적용하기

Dynamic Water Physics는 물에서의 움직임(운동)을 위한 패키지이고, Lux Water은 물 표면의 시각적효과를 위한 패키지. 둘을 함께 적용하는 방법 ① LuxWaterDataProvider.cs.txt 에서 txt제거. ② asmdef(assembly definition) 파일 수정 Due to inclusion of assembly definitions into this asset with v2.4 an additional step is required when setting up 3rd party water assets. The asset either needs to be referenced inside NWH.DWP2.asmdef or all the .asmdef (assembly..

Unity/Asset 분석 2021.05.30

[RTS Engine] Android 터치 커스터마이징 & Unity에서의 마우스 입력

PC용으로 만들어진 엔진이라 Android에 맞게 커스터마이징 필요. 마우스 이벤트 받는 부분 검색해서 코드 수정. 코드수정 SelectionManager.cs //did the player just press one of these buttons? bool leftButtonDown = Input.GetMouseButtonDown(0); bool rightButtonDown = Input.GetMouseButtonDown(1); 1 -> 0 유니티에서의 마우스 입력처리 버튼처리 마우스 버튼에 대한 입력은 일반적으로 Down, Hold, Up 이 세 가지 과정으로 나누어져서 처리된다. Down은 버튼을 누르는 순간을 의미하고 Hold는 누른 상태로 유지하는 것, Up은 눌려진 버튼을 떼는 것을 의미한다...

Unity/Asset 분석 2021.05.28

[RTS Engine] 유닛 추가하기(Unit Spawner)

이렇게 만들면 맵 위에 올려도 클릭도 안되고 조작도 안됨. 단지 Object를 하나 만드는 역할만 하는 듯 하다. -> [추가] GameManager에서 Faction 설정을 해줘야함 UnitSpawner라는 컴포넌트가 있는데, 이것을 이용해서 유닛을 Spawn해줘야 게임 시스템안에 녹아든다. Units: Drag and drop the unit prefabs (that have the main Unit component). Each time, one random unit will be chosen from this list to be spawned next. Player Faction: Check this field if you want to spawn the units for the player’s ..

Unity/Asset 분석 2021.05.28