示例#1
0
 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();
        }
    }
示例#3
0
    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;
    }
示例#5
0
    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);
                }
            }
        }
    }
示例#6
0
 private void LoadUnitRange()
 {
     _unitRange = gameObject.GetComponent <UnitRange>();
 }