// Use this for initialization void Start() { if(m_oPlatformManager == null){ //Assert.LogWarning("m_oPlatformManager not linked"); m_oPlatformManager = GameObject.FindObjectOfType<PlatformManager>(); if(m_oPlatformManager == null){ //Assert.LogError("No PlatformManager in the scene"); return; } Debug.Log("Status = " + m_oPlatformManager.GetPlatformStatus()); } if (m_oInptuManager == null) { //Assert.LogWarning("m_oInptuManager not linked"); m_oInptuManager = GameObject.FindObjectOfType<InputManager> (); if (m_oInptuManager == null) { //Assert.LogError ("No InputManager in the scene"); return; } } }
void Start() { if(m_oPlatformManager == null) { Debug.LogWarning("m_oPlatformManager not linked"); m_oPlatformManager = GameObject.FindObjectOfType<PlatformManager>(); if(m_oPlatformManager == null) { Debug.LogError("No PlatformManager in the scene"); return; } Debug.Log("Status = " + m_oPlatformManager.GetPlatformStatus()); } m_oInptuManager = GameObject.FindObjectOfType<InputManager>(); if(m_oInptuManager == null) { Debug.LogError("No InputManager in the scene"); } m_fShootingTime = m_oPlatformManager.GetShootingInterval(); m_oTimer = gameObject.AddComponent<Timer>(); m_oTimer.Start(m_fShootingTime, AllowShooting); m_oTransform = this.transform; CreateProjectiles(); m_rigidbody = gameObject.GetComponent<Rigidbody> (); }