void Awake()
 {
     //find collider
     _playerCollider = this.GetComponent <BoxCollider2D>();
     colorData       = this.gameObject.GetComponent <PlayerColorData>();
     _armor          = GameObject.FindObjectsOfType <PlayerArmor>();
     //state machine init
     attack  = _attack;
     block   = _block;
     machine = new PlayerStateMachine();
     doState = new state[] { Idle, Move, Jump, Jump2, InAirNow, Attack1, Attack2, Attack3, MovingAttack, InAirAttack, Parry, Block, Crouch, Hit, Dead };
 }
Example #2
0
 void Start()
 {
     //find player
     _player = GameObject.Find("player").GetComponent <PlayerColorData>();
 }