// Use this for initialization void Start () { behavior = gameObject.FindBehavior () as CharacterBehavior; motor = behavior.motor as CharacterMotor; inventory = behavior.inventory; // --- lastAttackTime = Mathf.NegativeInfinity; action = new AttackAction(); action.actionEnd = DoDamage; }
void Start () { unit = gameObject.GetUnit (); behavior = gameObject.FindBehavior () as CharacterBehavior; //behavior = unit.GetComponent<CharacterBahavior> (); // --- thisRigidbody = GetComponent <Rigidbody> (); thisCollider = GetComponent <Collider> (); joint = GetComponent <Joint> (); }