void Awake()
 {
     m_SpaceShipBehaviour          = FindObjectOfType <SpaceShipBehaviour>();
     m_PlayerHealth                = m_SpaceShipBehaviour.GetComponent <Health>();
     m_SpaceShipBehaviourTransform = m_SpaceShipBehaviour.transform;
     m_InfiniteLevelManager        = FindObjectOfType <InfiniteLevelManager>();
     m_ObjectSpawner               = FindObjectOfType <ObjectSpawner>();
     m_GUIManager = FindObjectOfType <GUIManager>();
     m_State      = State.Running;
 }
예제 #2
0
        void Awake()
        {
            SpaceShipBehaviour spaceship = FindObjectOfType <SpaceShipBehaviour>();

            if (spaceship != null)
            {
                m_PlayerHealth = spaceship.GetComponent <Health>();
            }
            m_GameplayManager      = FindObjectOfType <GameplayManager>();
            m_InfiniteLevelManager = FindObjectOfType <InfiniteLevelManager>();
        }
예제 #3
0
        private void HitPlayer(SpaceShipBehaviour player)
        {
            Health playerHealth = player.GetComponent <Health>();

            if (m_HealthToAddOnHit.HealthValue > 0)
            {
                PlayAudioManager.PlayHitIncrease();
            }
            else
            {
                PlayAudioManager.PlayHitDecrease();
            }
            playerHealth.HealthValue += m_HealthToAddOnHit.HealthValue;
            Destroy(this.gameObject);
        }