public IdleState(ICharacterBehaviour behaviour, Character character) { this.character = character; idleDoneCooldown = new Cooldown(character.idleLength); idleDoneCooldown.SetRandom(); this.behaviour = behaviour; }
// Use this for initialization void Start() { billBoard = GetComponentInChildren <Billboard> (); Debug.Assert(billBoard != null); character = GetComponent <Character> (); Debug.Assert(character != null); blockComponent = GetComponent <BlockComponent> (); Debug.Assert(blockComponent != null); if (blockComponent.surface == null) { Destroy(gameObject); } switch (character.behaviourType) { case BehaviourType.Melee: behaviour = gameObject.AddComponent <MeleeBehaviour> (); break; case BehaviourType.Range: behaviour = gameObject.AddComponent <RangeBehaviour> (); break; } characterAI = gameObject.AddComponent <CharacterAI> (); characterAI.behaviour = behaviour; animator = GetComponentInChildren <Animator> (); Debug.Assert(animator != null); var animationEvents = animator.GetBehaviour <CritterAnimationEvents> (); animationEvents.animationInfo = character.animationInfo; }
// Use this for initialization void Start() { Rigidbody2D rigidbody = GetComponent <Rigidbody2D>(); behaviour = new CharacterMoveBehaviour(rigidbody, speed); }
public AttackState(ICharacterBehaviour behaviour, Character character, Character target) { this.behaviour = behaviour; this.character = character; this.target = target; }
public PatrolState(ICharacterBehaviour behaviour, Character character) { this.character = character; this.behaviour = behaviour; }
private void Awake() { lifes = 3; characterBehaviour = GetComponent <ICharacterBehaviour>(); }