private void Update()
 {
     if (m_controlRotation == null)
     {
         m_controlRotation = FindObjectOfType <Pipe_Rotation>();
     }
 }
예제 #2
0
    // Toggles between the tilt control and button control
    public void ControlToggle()
    {
        // Finds a reference to the Pipe rotation script
        if (m_controlRotation == null)
        {
            m_controlRotation = FindObjectOfType <Pipe_Rotation>();
        }

        // Toggles the controller slider in option menu and hides buttons when using tilt control
        if (m_controllerToggle != null)
        {
            tiltControl = !tiltControl;
            ReinitialiseControl();
            if (m_controlRotation != null)
            {
                m_controlRotation.touchOn = tiltControl ? false : true;
            }
        }
    }
 public void GameRestart()
 {
     m_controlRotation = null;
 }