示例#1
0
 protected override void InnerInit(UnitContainer unit)
 {
     base.InnerInit(unit);
     m_AttackControl.Init(m_Unit.TF);
     m_AttackControl.AttackEvents   += OnClickAttack;
     m_Unit.UnitControl.AttackEvent += () => { m_SendData.Attack.AttackID++; };
     m_Unit.LifeControl.DeathEvent  += (sender, arg) => { if (IsServer)
                                                          {
                                                              m_SendData.LifeID++;
                                                          }
     };
 }
示例#2
0
 private void SetupAttack()
 {
     _attackController = GetComponent <AttackController>();
     if (_attackController == null)
     {
         Debug.LogError("Unit has no Attack controller.");
         return;
     }
     Intell.SetupAtackSensor(_attackController);
     _attackController.Intell = Intell;
     _attackController.Init(_unit, MoveController);
 }