public void ActivateRotation()
 {
     if (!m_CanRotate)
     {
         m_CanRotate = true;
         m_SoundFX.PlayAudio(true);
         Invoke("DeactivateRotation", m_DeactivateTimer);
     }
 }
    public void ActivateRotation()
    {
        if (!can_Rotate)
        {
            can_Rotate = true;

            soundFX.PlayAudio(true);

            // deactivate
            Invoke("DeactivateRotation", deactivateTimer);
        }
    } // activate rotaton
Пример #3
0
    // Provide the functionality of movement to the platform
    public void ActivateMovementToFinal()
    {
        m_CanMove = true;

        // play sound
        m_PlatformSoundFX.PlayAudio(true);
        // rotate

        if (m_ActivateRotation)
        {
            m_RotatingPlatform.ActivateRotation();
        }
    }
Пример #4
0
 void OnTriggerEnter(Collider other)
 {
     if (other.CompareTag(TagManager.PLAYER))
     {
         m_RotatingPlatform.ActivateRotation();
         m_SoundFX.PlayAudio(true);
     }
 }
    void OnTriggerEnter(Collider target)
    {
        if (target.CompareTag(TagManager.PLAYER) && !m_LevelFinished)
        {
            m_LevelFinished = true;
            m_SoundFX.PlayAudio(true);

            if (!m_NextLevelName.Equals(""))
            {
                Invoke("LoadNewLevel", m_NextLevelTimer);
            }
        }
    }
    private void MovePlatform()
    {
        if (can_Move)
        {
            transform.position = Vector3.MoveTowards(transform.position,
                                                     movePoint.position, smoothMovement);

            if (Vector3.Distance(transform.position, movePoint.position) <= halfDistance)
            {
                if (!smoothMovementHalfed)
                {
                    smoothMovement      /= 2f;
                    smoothMovementHalfed = true;
                }
            }

            if (Vector3.Distance(transform.position, movePoint.position) == 0f)
            {
                can_Move = false;

                if (smoothMovementHalfed)
                {
                    smoothMovement       = initialMovement;
                    smoothMovementHalfed = false;
                }

                // deactivate doors
                if (deactivateDoors)
                {
                    doorController.OpenDoors();
                }

                // stop playing the sound FX
                soundFX.PlayAudio(false);
            }
        }
    } // move platform
Пример #7
0
    private void OnTriggerEnter(Collider target)
    {
        if (target.CompareTag(Tags.Player_Tag))
        {
            if (!levelFinished)
            {
                levelFinished = true;

                soundFX.PlayAudio(true);

                if (!nextLevelName.Equals(""))
                {
                    Invoke("LoadNewLevel", timer);
                }
            }
        }
    }