Ejemplo n.º 1
0
    internal void Init(Battle _battle, Simulator _simulator, bool _isMine, int _uid, int _id, bool _isBase, IUnitSDS _sds, Vector2 _pos)
    {
        battle     = _battle;
        simulator  = _simulator;
        isMine     = _isMine;
        uid        = _uid;
        id         = _id;
        isBase     = _isBase;
        sds        = _sds;
        nowHp      = sds.GetHp();
        attackStep = 0;
        targetUid  = -1;

        if (sds.GetSkill() != 0)
        {
            CastSkill();
        }

        simulator.addAgent(uid, _pos);
        InitSds();
    }
Ejemplo n.º 2
0
        public void Init(BattleCore _battleCore, bool _isMine, IUnitSDS _sds, int _uid, int _pos, int _time)
        {
            battleCore = _battleCore;

            isMine = _isMine;

            sds = _sds;

            uid = _uid;

            pos = _pos;

            hp = sds.GetHp();

            state = UnitState.CD;

            if (sds.GetLiveTime() > 0)
            {
                dieTime = _time + sds.GetLiveTime();
            }

            Turrent[] turrentPos = isMine ? battleCore.mTurrent : battleCore.oTurrent;

            for (int i = 0; i < sds.GetPos().Length; i++)
            {
                int posFix = sds.GetPos()[i];

                ITurrentSDS turrentSDS = sds.GetTurrent()[i];

                Turrent turrent = new Turrent();

                turrent.Init(battleCore, this, turrentSDS, pos + posFix, _time);

                turrentPos[pos + posFix] = turrent;

                turrentList.Add(turrent);
            }
        }