// Update is called once per frame void Update() { if (player == null) { GameObject obj = GameObject.FindGameObjectWithTag("Player"); if (obj != null) { player = obj.GetComponent <Player_Ctrl>(); } } }
public void Clear() { if (PlayEnd != true) { Time.timeScale = 0; PlayEnd = true; FinalMessage.text = "Clear!!"; Player_Ctrl PC = GameObject.Find("Player").GetComponent <Player_Ctrl>(); float score = 12345f + Limit_Time * 123f + PC.hp * 123f; FinalScoreLabel.text = string.Format("{0:N0}", score); FinalGUI.SetActive(true); BestCheck(score); } }
public void GameOver() { if (PlayEnd != true) { Time.timeScale = 0f; PlayEnd = true; FinalMessage.text = "Fail..."; float score = 1234f + Enemy_Count * 123f; FinalScoreLabel.text = string.Format("{0:N0}", score); FinalGUI.SetActive(true); BestCheck(score); Player_Ctrl PC = GameObject.Find("Player").GetComponent <Player_Ctrl>(); PC.PS = PlayerState.Dead; } }
// Use this for initialization void Awake() { Instance = this; }