private void Awake() { stateMachine = new StateMachine(); var camera = Camera.main.GetComponent <CameraFollower>(); waitingState = new Waiting(stateMachine, this, animatorCharacter); runningState = new Running(stateMachine, this, camera, animatorCharacter); shootingState = new Shooting(stateMachine, this, camera, animatorCharacter); deathState = new Death(stateMachine, this); resultPanelState = new ResultPanelState(stateMachine, this); health = GetComponent <Health>(); stateMachine.Initialize(waitingState); StartWaiting(); }
// Start is called before the first frame update void Start() { screens = new GameObject[] { overallPanel, detailedPanel, readyForNextBattlePanel }; currentState = ResultPanelState.Overall; overallPanel.SetActive(true); overallPlayerNumber.text = "P" + controllingPlayer.playerNumber; overallCharacterImage.sprite = Ron; overallCharacterName.text = controllingPlayer.selectedCharacter.ToString(); overallPlayerName.text = controllingPlayer.playerName; overallRankImage.sprite = Ron; detailedCharacterImage.sprite = Ron; detailedCharacterName.text = controllingPlayer.selectedCharacter.ToString(); detailedPlayerName.text = controllingPlayer.playerName; killText.text = "Kills: " + controllingPlayer.Kills; deathText.text = "Deaths: " + controllingPlayer.Deaths; totalText.text = "Total: " + controllingPlayer.Total; detailedRankImage.sprite = Ron; }