static FileSizeHelper() { for (var i = 0; i < _unitRanges.Length; i++) { _unitRanges[i] = new UnitRange(i + 1); } }
private void Awake() { Instance = this; for (int i = 0; i < MaxUnitRanges; i++) { UnitRanges[i] = new UnitRange(); } }
public void InitUnitProperty(int unitID, float addShild, float addEnegy, int addAward, int seqspline) { SetUnitTempate(unitID); UnitRange range = transform.root.GetComponentInChildren <UnitRange>(); range.SetAttackRange(m_UnitTemplate.m_Range); SetUnitAddProperty(addShild, addEnegy, addAward); seqSplineGuide = seqspline; InitUnitMovement(); }
public void Initialize(Faction faction, UnitRange unitrange, UnitType unittype, int healthamount, int damageamount, float movespeed, int goldcost, RuntimeAnimatorController animator, Sprite unitsprite) { m_faction = faction; m_unitrange = unitrange; m_unittype = unittype; m_health = healthamount; m_damage = damageamount; m_movespeed = movespeed; m_goldcost = goldcost; m_animator = animator; GetComponent <SpriteRenderer>().sprite = unitsprite; }
void OnTriggerEnter(Collider other) { UnitRange range = other.GetComponent <UnitRange>(); if (range != null) { if (m_CoreType == 1) // maincore는 모든유닛들이 공격 { UnitBase unit = range.transform.root.GetComponentInChildren <UnitBase>(); unit.AddDestroyTarget(m_CoreID); } else // subcore는 지상유닛만 공격함 { UnitWalking unit = range.transform.root.GetComponentInChildren <UnitWalking>(); if (unit != null) { unit.AddDestroyTarget(m_CoreID); } } } }
private void LoadUnitRange() { _unitRange = gameObject.GetComponent <UnitRange>(); }