ㅇ
protected void Bind<T>(Type type) where T : UnityEngine.Object
{
string[] names = Enum.GetNames(type); //enum 이름을 UI 이름으로 가정
UnityEngine.Object[] objects = new UnityEngine.Object[names.Length];
_objects.Add(typeof(T), objects);
for (int i = 0; i < names.Length; i++)
{
//GameObject면 그대로 찾고 나머지는 제너릭으로 타입 변환하여 찾기
if (typeof(T) == typeof(GameObject))
{
objects[i] = Util.FindChild(gameObject, names[i], true);
}
else
{
objects[i] = Util.FindChild<T>(gameObject, names[i], true);
}
}
}
protected void BindObject(Type type) { Bind<GameObject>(type); }
protected void BindImage(Type type) { Bind<Image>(type); }
protected void BindText(Type type) { Bind<TextMeshProUGUI>(type); }
protected void BindButton(Type type) { Bind<Button>(type); }
protected void BindToggle(Type type) { Bind<Toggle>(type); }
public abstract class EquipmentManager<TState> where TState : ItemState
{
// 고정된 슬롯으로 장착된 아이템 관리
protected TState[] _equippedSlots;
public IReadOnlyList<TState> EquippedSlots => _equippedSlots;
public virtual int Equip(TState itemState)
{
// 장착 로직
}
}
public class GearEquipment : EquipmentManager<GearState>
public class SkillEquipment : EquipmentManager<SkillState>
public class PartyEquipment : EquipmentManager<PartyState>
JSON 기반 스킬 시스템 자동화
핵심 로직은 Skill.cs, 실행 조건은 SkillUseService에서 처리하여 유지보수성과 확장성을 높였습니다.
public bool TryExecute(Vector3 origin, List<IDamageable> enemiesInScene)
{
// 버프 스킬은 별도 처리
if (_data.executeType == SkillExecuteType.Buff)
{
ApplyBuff();
return true;
}
// 실행 방식에 따른 분기 처리
switch (_data.executeType)
{
case SkillExecuteType.DoubleSlash:
break;
case SkillExecuteType.Projectile:
break;
case SkillExecuteType.AreaRepeat:
break;
case SkillExecuteType.MultiHit:
break;
case SkillExecuteType.SingleHit:
case SkillExecuteType.Default:
break;
}
return true;
}
Firebase Functions와 Railway 기반 MySQL DB를 연동해 API 서버를 구축하고, Node.js를 이용한 API를 구현했습니다. 이후에는 Google 로그인 기능과 연계하여 사용자별 데이터를 저장하고 관리할 수 있도록 확장할 계획입니다.