Exemple #1
0
 void Update()
 {
     //key down inputs
     if (m_ollieBtn.m_shouldJump)
     {
         if (m_controller.TouchingGround)
         {
             m_controller.Jump();
         }
         else
         {
             if (!m_controller.DropIn())
             {
                 m_controller.Grind();
             }
         }
         m_ollieBtn.m_shouldJump = false;
     }
     //key up Inputs
 }
Exemple #2
0
    void Update()
    {
        //key inputs
        if (Input.GetKeyUp(KeyCode.Space))
        {
            if (m_controller.TouchingGround)
            {
                m_controller.Jump();
            }
        }

        if (Input.GetKeyUp(KeyCode.LeftShift))
        {
            if (!m_controller.TouchingGround)
            {
                if (!m_controller.DropIn())
                {
                    m_controller.Grind();
                }
            }
        }
    }