Exemple #1
0
    private void Start()
    {
        anim           = GetComponent <Animator>();
        cc             = GetComponent <CharacterController>();
        AttackDecision = GetComponent <AttackDetectionTwo>();
        gamePanel      = GameObject.Find("Canvas").transform.GetChild(0).GetComponent <GamePanel>();

        IdleState          idle           = new IdleState(1, this);
        RunState           Runing         = new RunState(2, this);
        RollState          Rolling        = new RollState(3, this);
        AttackState        attack         = new AttackState(4, this);
        SwitchWeaponsState switchWeapons  = new SwitchWeaponsState(5, this);
        GetHitAndDeath     getHitAndDeath = new GetHitAndDeath(6, this);
        ForceState         force          = new ForceState(7, this);

        machine = new StateMachine(idle);
        machine.AddState(Runing);
        machine.AddState(Rolling);
        machine.AddState(attack);
        machine.AddState(switchWeapons);
        machine.AddState(getHitAndDeath);
        machine.AddState(force);
    }
 private void Start()
 {
     PlayerAttackDec = GameObject.FindGameObjectWithTag("Player").GetComponent <AttackDetectionTwo>();
     gamePanel       = GameObject.Find("Canvas").transform.GetChild(0).GetComponent <GamePanel>();
 }
Exemple #3
0
 void Start()
 {
     AttackDetTwo = this.transform.root.GetChild(0).GetComponent <AttackDetectionTwo>();
     AttackDetTwo.detectionOnes.Add(this);
 }