private void MovementAudio()
    {
        if (!groundCheck.isGrounded)
        {
            if (m_MovementAudio.isPlaying)
            {
                m_MovementAudio.Stop();
            }
            return;
        }
        // Play the correct audio clip based on whether or not the player is moving and what audio is currently playing.

        // Checks if the player is moving
        if (!CheckMovement() || MainRooms.IsRotating())
        {
            m_MovementAudio.Stop();
        }
        else
        {
            if (!m_MovementAudio.isPlaying)
            {
                m_MovementAudio.Play();
            }
        }
    }
 private void Turn()
 {
     if (CheckMovement() && !MainRooms.IsRotating())
     {
         transform.LookAt(movementDirection);
     }
 }
Пример #3
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
Пример #4
0
        private void btnMainRoom_Click(object sender, EventArgs e)
        {
            this.Visible = false;
            MainRooms frmMainRoom = new MainRooms();

            frmMainRoom.ShowDialog();
            this.Close();
        }
    private void Move()
    {
        // Adjust the position of the player based on the player's input.
        if (CheckMovement() && !MainRooms.IsRotating())
        {
            movementDirection = m_Rigidbody.position + (Vector3.forward * m_HorizontalMovementInputValue + Vector3.right * m_VerticalMovementInputValue) * m_Speed * Time.deltaTime;

            m_Rigidbody.MovePosition(movementDirection);
        }
    }
Пример #6
0
 void OnCollisionStay(Collision other)
 {
     if (hit)
     {
         currHitTime += Time.deltaTime;
         if (currHitTime >= hitTimeLimit)
         {
             MainRooms.Rotate();
             hit         = false;
             currHitTime = 0f;
         }
     }
 }