Unity/게임 개발 스터디

게임 개발 스터디 14 : 추가사항 정리

sorry0101 2022. 11. 21. 12:07

1. 캐릭터 정보

  • 캐릭터 별PID
  • 이름 -> object를 클릭하면 자동 바인딩
  • 이미지 -> Texture2D
  • 레벨 -> int
  • 등급 -> dropdown string
  • 타입(공격, 방어, 민첩 등) -> dropdown string
  • 사운드
  • 설명(Description)
  • 기존에 있던 값(HP, ATK, ATKRange, Weight, exp) -> float

2. 바인딩 예제 참고

https://docs.unity3d.com/Manual/UIE-binding-examples.html

 

3. 자동 바인딩

CharacterData.cs를 CharacterBuilder.cs에서 자동 바인딩

https://ansohxxn.github.io/unity%20lesson%202/ch7-4/

 

4. 수정

 

5. type 관련 코드 간결화

key, value 로 저장해서 switch-case문을 사용할 수 있다는 것이 놀라웠음.

https://stackoverflow.com/questions/708911/using-case-switch-and-gettype-to-determine-the-object

 

Using Case/Switch and GetType to determine the object

Possible Duplicate: C# - Is there a better alternative than this to ‘switch on type’? If you want to switch on a type of object, what is the best way to do this? Code snippet private int GetNodeType(

stackoverflow.com