// Use this for initialization protected virtual void Start () { state = GetComponentInChildren<UnitState>(); motor = GetComponentInChildren<UnitMotor>(); viewer = GetComponentInChildren<UnitViewer>(); listener = GetComponentInChildren<UnitListener>(); attack = GetComponentInChildren<CharacterAttack>(); inventory = GetComponentInChildren<UnitInventory>(); buffs = GetComponentInChildren<UnitBuffs>(); unitTransform = GetComponentInChildren<UnitTransform>(); selectBehavior = GetComponentInChildren<SelectBehavior>(); //UnitsEventSystem.AddUnit (gameObject); }
public void OnTargetDeath (UnitState.UnitStateEventArgs args) { if (target == args.unit) { ClearTarget (); } else { Debug.LogError ("CharacterAttack -> target != unit in OnTargetDeath()"); } }