// Use this for initialization void Start() { // set the current game state GameState = "Started"; // grab the attached guiscript component m_GuiText = this.GetComponent <GuiTextScript>(); // Set some values on the guiscript component m_GuiText.SetCans(m_FallenCans, m_Cans - m_FallenCans); // restore last cameraposition, if there // is one saved. Camera.main.transform.position = new Vector3( GameManagerScript.LastCameraXPosition, Camera.main.transform.position.y, Camera.main.transform.position.z); }
// with this method, other scripts // can notify the gamemanager that // a cans is knocked down public void ReportFallenCan() { m_FallenCans++; GameManagerScript.TotalNumberCans++; m_GuiText.SetCans(m_FallenCans, m_Cans - m_FallenCans); }
// Use this for initialization void Start() { // set the current game state GameState = "Started"; // grab the attached guiscript component m_GuiText = this.GetComponent<GuiTextScript>(); // Set some values on the guiscript component m_GuiText.SetCans(m_FallenCans,m_Cans - m_FallenCans); // restore last cameraposition, if there // is one saved. Camera.main.transform.position = new Vector3( GameManagerScript.LastCameraXPosition, Camera.main.transform.position.y, Camera.main.transform.position.z); }