/* * \brief Called when the object is created. At the start. * Only called once per instaniation. */ public void Start() { if (INSTANCE == null) { INSTANCE = this; CGUIOptions.GetInstance().ApplyOptions(); } m_transform = this.transform; DistanceFromPlayer = InitialDistanceFromPlayer; m_playerEntity = CEntityPlayer.GetInstance(); if (m_playerEntity == null) { m_playerEntity = GameObject.Find("Player Spawn").GetComponent <CEntityPlayer>(); } m_playerPelvis = m_playerEntity.transform.FindChild("Player_Mesh/Bip001/Bip001 Pelvis"); m_currentTransform = m_playerPelvis; m_storedPositions = new ArrayList(); m_storedPositions.Add(m_currentTransform.position); m_countIgnoredFrames = 0; m_storedCameraPositions = new ArrayList(); m_credits = this.gameObject.GetComponentInChildren <CEndCredits>(); if (m_credits) { m_credits.gameObject.SetActiveRecursively(false); } if (this.transform.FindChild("Background")) { m_creditsBackground = this.transform.FindChild("Background").gameObject; if (m_creditsBackground) { m_creditsBackground.SetActiveRecursively(false); } } }
/* * \brief Called when the object is created. At the start. * Only called once per instaniation. */ public void Start() { if (INSTANCE == null) { INSTANCE = this; CGUIOptions.GetInstance().ApplyOptions(); } m_transform = this.transform; DistanceFromPlayer = InitialDistanceFromPlayer; m_playerEntity = CEntityPlayer.GetInstance(); if (m_playerEntity == null) { m_playerEntity = GameObject.Find("Player Spawn").GetComponent<CEntityPlayer>(); } m_playerPelvis = m_playerEntity.transform.FindChild("Player_Mesh/Bip001/Bip001 Pelvis"); m_currentTransform = m_playerPelvis; m_storedPositions = new ArrayList(); m_storedPositions.Add(m_currentTransform.position); m_countIgnoredFrames = 0; m_storedCameraPositions = new ArrayList(); m_credits = this.gameObject.GetComponentInChildren<CEndCredits>(); if(m_credits) { m_credits.gameObject.SetActiveRecursively(false); } if(this.transform.FindChild("Background")) { m_creditsBackground = this.transform.FindChild("Background").gameObject; if(m_creditsBackground) { m_creditsBackground.SetActiveRecursively(false); } } }