Exemple #1
0
    public void ClearRegisterKey()
    {
        for (int i = 0; i < 4; i++)
        {
            CrossPlatformInputManager.UnRegisterVirtualAxis(hrztaxis_n + i);
            CrossPlatformInputManager.UnRegisterVirtualAxis(vtcaxis_n + i);
            HRZTAxis[i] = null;
            VTCAxis[i]  = null;
        }

        for (int i = 0; i < 4; i++)
        {
            CrossPlatformInputManager.UnRegisterVirtualButton(nmatk_n + i);
            CrossPlatformInputManager.UnRegisterVirtualButton(fr1_n + i);
            CrossPlatformInputManager.UnRegisterVirtualButton(fr2_n + i);
            CrossPlatformInputManager.UnRegisterVirtualButton(fr3_n + i);
            CrossPlatformInputManager.UnRegisterVirtualButton(sk1_n + i);
            CrossPlatformInputManager.UnRegisterVirtualButton(sk2_n + i);
            CrossPlatformInputManager.UnRegisterVirtualButton(sk3_n + i);
            CrossPlatformInputManager.UnRegisterVirtualButton(trail_n + i);
            NMATK[i] = null;
            FR1[i]   = null;
            FR2[i]   = null;
            FR3[i]   = null;
            SK1[i]   = null;
            SK2[i]   = null;
            SK3[i]   = null;
            TRAIL[i] = null;
        }

        NetworkServer.Shutdown();
    }
 void Start()
 {
     if (CrossPlatformInputManager.ButtonExists(Name))
     {
         CrossPlatformInputManager.UnRegisterVirtualButton(Name);
     }
     myBt = new CrossPlatformInputManager.VirtualButton(Name);
     CrossPlatformInputManager.RegisterVirtualButton(myBt);
 }
Exemple #3
0
 void CreateVirtualButton()
 {
     if (m_ButtonName != "")
     {
         if (CrossPlatformInputManager.ButtonExists(m_ButtonName))
         {
             CrossPlatformInputManager.UnRegisterVirtualButton(m_ButtonName);
         }
         m_VirtualButton = new CrossPlatformInputManager.VirtualButton(m_ButtonName);
         CrossPlatformInputManager.RegisterVirtualButton(m_VirtualButton);
     }
 }
        void OnDisable()
        {
            // Unsubscribe trigger events
            if (powerType == PowerType.Joystick)
            {
                PowerJoystick.OnJoyPosHTriggerButtonDown -= PosHTriggerButtonDown;
                PowerJoystick.OnJoyPosHTriggerButtonUp   -= PosHTriggerButtonUp;
                PowerJoystick.OnJoyNegHTriggerButtonDown -= NegHTriggerButtonDown;
                PowerJoystick.OnJoyNegHTriggerButtonUp   -= NegHTriggerButtonUp;
                PowerJoystick.OnJoyPosVTriggerButtonDown -= PosVTriggerButtonDown;
                PowerJoystick.OnJoyPosVTriggerButtonUp   -= PosVTriggerButtonUp;
                PowerJoystick.OnJoyNegVTriggerButtonDown -= NegVTriggerButtonDown;
                PowerJoystick.OnJoyNegVTriggerButtonUp   -= NegVTriggerButtonUp;
            }
            if (powerType == PowerType.DPad)
            {
                PowerDPad.OnDPadPosHTriggerButtonDown -= PosHTriggerButtonDown;
                PowerDPad.OnDPadPosHTriggerButtonUp   -= PosHTriggerButtonUp;
                PowerDPad.OnDPadNegHTriggerButtonDown -= NegHTriggerButtonDown;
                PowerDPad.OnDPadNegHTriggerButtonUp   -= NegHTriggerButtonUp;
                PowerDPad.OnDPadPosVTriggerButtonDown -= PosVTriggerButtonDown;
                PowerDPad.OnDPadPosVTriggerButtonUp   -= PosVTriggerButtonUp;
                PowerDPad.OnDPadNegVTriggerButtonDown -= NegVTriggerButtonDown;
                PowerDPad.OnDPadNegVTriggerButtonUp   -= NegVTriggerButtonUp;
            }
            // Unsubscribe normal button events
            if (powerType == PowerType.Button)
            {
                PowerButton.OnPowerButtonDown -= OnPowerButtonDown;
                PowerButton.OnPowerButtonUp   -= OnPowerButtonUp;
            }

            // Unregister axis and button
            if (horizontalAxis != null && CrossPlatformInputManager.AxisExists(horizontalAxis.name))
            {
                CrossPlatformInputManager.UnRegisterVirtualAxis(horizontalAxis.name);
            }
            if (verticalAxis != null && CrossPlatformInputManager.AxisExists(verticalAxis.name))
            {
                CrossPlatformInputManager.UnRegisterVirtualAxis(verticalAxis.name);
            }
            if (buttonAxis != null && CrossPlatformInputManager.AxisExists(buttonAxisName))
            {
                CrossPlatformInputManager.UnRegisterVirtualAxis(buttonAxisName);
            }
            if (button != null && CrossPlatformInputManager.ButtonExists(button.name))
            {
                CrossPlatformInputManager.UnRegisterVirtualButton(button.name);
            }
        }
Exemple #5
0
 private void OnDisable()
 {
     button.SetAxisNeutralState();
     CrossPlatformInputManager.UnRegisterVirtualButton(arrowKeyName);
 }
 private void OnDestroy()
 {
     CrossPlatformInputManager.UnRegisterVirtualAxis("Horizontal");
     CrossPlatformInputManager.UnRegisterVirtualButton("Jump");
 }