Exemplo n.º 1
0
        private void Update()
        {
            bool isMissedConditions = !m_HasTriggered && !m_sclera.activeSelf && !m_hasMissed && !m_Dolphin.GetComponent <DolphinScript>().isInvincible;

            if ((transform.position.z < m_Cam.position.z - k_MissedDistance) && isMissedConditions)
            {
                SessionData.ResetCombo();
                m_health.TakeDamage(m_MissDamage);
                m_hasMissed = true;
            }

            // If the ring is far enough behind the camera and something is subscribed to OnRingRemove call it.
            if (transform.position.z < m_Cam.position.z - k_RemovalDistance)
            {
                if (OnRingRemove != null)
                {
                    OnRingRemove(this);
                }
            }

            if (m_beatEvent.GetComponent <BeatEventScript>().isBeat)
            {
                m_halo.SetActive(true);
                m_halo.GetComponent <ParticleSystem>().Play();
            }
            else
            {
                m_halo.SetActive(false);
            }
        }
Exemplo n.º 2
0
        private void OnTriggerEnter(Collider other)
        {
            // Only continue if the asteroid has hit the flyer.
            if (other.gameObject != m_Flyer)
            {
                return;
            }

            // Damage the flyer.
            m_FlyerHealthController.TakeDamage(m_PlayerDamage);

            // If the damage didn't kill the flyer add to the score and call the appropriate events.
            if (!m_FlyerHealthController.IsDead)
            {
                Hit();
            }
        }
Exemplo n.º 3
0
        private void OnTriggerEnter(Collider other)
        {
            // Only continue if the myst has hit the flyer.
            if (other.gameObject != m_Flyer || m_Dolphin.isInvincible)
            {
                return;
            }

            // Damage the flyer.
            m_FlyerHealthController.TakeDamage(m_PlayerDamage);

            m_Dolphin.SwapColour(); // Dolphin will change colour on collision.


            // If the damage didn't kill the flyer add to the score and call the appropriate events.
            if (!m_FlyerHealthController.IsDead)
            {
                Hit();
            }
        }
Exemplo n.º 4
0
        private void OnTriggerEnter(Collider other)
        {
            Debug.Log("Opponent hit...");

            // Only continute if the opponent laze hit the flyer
            if (other.gameObject != m_Flyer)
            {
                return;
            }

            // Damage the flyer

            m_Hit = true;

            Debug.Log("Flyer take damage");
            flyerHealthController.TakeDamage(10);


            // Return the laser to the object pool.
            ObjectPool.ReturnGameObjectToPool(gameObject);
            Debug.Log("opponent laser hit...");
        }