예제 #1
0
        public void Update()
        {
            Stage        stage = this.Stage;
            Queue <long> queue = stage.GetUnitCompoents(unitCompoentType);

            if (queue == null)
            {
                return;
            }

            while (queue.Count > 0)
            {
                long unitId = queue.Dequeue();

                UnitMoveComponent instance = stage.GetUnitCompoent <UnitMoveComponent>(unitId, unitCompoentType);
                if (instance == null)
                {
                    continue;
                }

                updates.Enqueue(unitId);

                Log.Info($"UnitMoveSystem.Update: StageName={Stage.StageName} Unit.Name={instance.Unit.Name} ");
            }

            Stage.SwapUnitCompoents(unitCompoentType, ref updates);
        }
예제 #2
0
            public void Init(UnitConfigData data)
            {
                Data = data;

                mAttributes [(int)FighterAttributeType.Life]        = data.life;
                mAttributes [(int)FighterAttributeType.Speed]       = data.speed;
                mAttributes [(int)FighterAttributeType.Attack]      = data.attack;
                mAttributes [(int)FighterAttributeType.AttackRange] = data.attackRange;

                Position = Data.borthPos;
                ID       = Data.id;
                IsDead   = false;

                mAI = new UnitAIComponent(this);
                mAI.Init();

                skillComp = new UnitSkillComponent(this);
                skillComp.Init((data.skillList));

                moveComp = new UnitMoveComponent();
                moveComp.Init(this);

                buffComp = new UnitBuffComponent(this);
            }
예제 #3
0
 public BattleUnit()
 {
     _move = AddComponent <UnitMoveComponent>();
 }