// Use this for initialization void Start() { fsmManager = new FSMManager((int)AnimationEnum.Max); Animator animator = GetComponent <Animator>(); PlayerWait tmpWait = new PlayerWait(animator); fsmManager.AddState(tmpWait); PlayerJump tmpJump = new PlayerJump(animator, this); fsmManager.AddState(tmpJump); PlayerWalk tmpWalk = new PlayerWalk(animator); fsmManager.AddState(tmpWalk); PlayerWait02 tmpWait02 = new PlayerWait02(animator); fsmManager.AddState(tmpWait02); }
private void Awake() { playerStats = GetComponent <Player>(); sPlayerWait = new PlayerWait(this); sPlayerDead = new PlayerDead(this); sPlayerChaseBall = new PlayerChaseBall(this); sPlayerRunAndDribble = new PlayerRunAndDribble(this); sPlayerActionDecision = new PlayerActionDecision(this); sPlayerMovementDecision = new PlayerMovementDecision(this); sPlayerMovingToPosition = new PlayerMovingToPosition(this); //load an HP bar from the resources folder. GameObject g = (GameObject)Instantiate(Resources.Load("Prefabs/HealthBar")); g.SendMessage("SetOwner", playerStats); }
public void InitPlayerWait() { this.playerWait = new PlayerWait(this._name, this._playerTurn); }