コード例 #1
0
 public IdleState(ICharacterBehaviour behaviour, Character character)
 {
     this.character   = character;
     idleDoneCooldown = new Cooldown(character.idleLength);
     idleDoneCooldown.SetRandom();
     this.behaviour = behaviour;
 }
コード例 #2
0
    // 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;
    }
コード例 #3
0
ファイル: Character.cs プロジェクト: IAmEska/PointClick
    // Use this for initialization
    void Start()
    {
        Rigidbody2D rigidbody = GetComponent <Rigidbody2D>();

        behaviour = new CharacterMoveBehaviour(rigidbody, speed);
    }
コード例 #4
0
ファイル: AttackState.cs プロジェクト: will3/Cubical-planet
 public AttackState(ICharacterBehaviour behaviour, Character character, Character target)
 {
     this.behaviour = behaviour;
     this.character = character;
     this.target    = target;
 }
コード例 #5
0
ファイル: PatrolState.cs プロジェクト: will3/Cubical-planet
 public PatrolState(ICharacterBehaviour behaviour, Character character)
 {
     this.character = character;
     this.behaviour = behaviour;
 }
コード例 #6
0
ファイル: Character.cs プロジェクト: MrSlatSlatius/UpWeGo
 private void Awake()
 {
     lifes = 3;
     characterBehaviour = GetComponent <ICharacterBehaviour>();
 }