예제 #1
0
        void OnDisable()
        {
            if (RG_CrossPlatformInputManager.AxisExists(horizontalAxisName))
            {
                RG_CrossPlatformInputManager.UnRegisterVirtualAxis(horizontalAxisName);
            }

            if (RG_CrossPlatformInputManager.AxisExists(verticalAxisName))
            {
                RG_CrossPlatformInputManager.UnRegisterVirtualAxis(verticalAxisName);
            }
        }
예제 #2
0
 void OnEnable()
 {
     if (!RG_CrossPlatformInputManager.AxisExists(axisName))
     {
         // if the axis doesnt exist create a new one in cross platform input
         m_Axis = new RG_CrossPlatformInputManager.VirtualAxis(axisName);
         RG_CrossPlatformInputManager.RegisterVirtualAxis(m_Axis);
     }
     else
     {
         m_Axis = RG_CrossPlatformInputManager.VirtualAxisReference(axisName);
     }
     FindPairedButton();
 }
예제 #3
0
        void CreateVirtualAxes()
        {
            // set axes to use
            m_UseX = (axesToUse == AxisOption.Both || axesToUse == AxisOption.OnlyHorizontal);
            m_UseY = (axesToUse == AxisOption.Both || axesToUse == AxisOption.OnlyVertical);

            // create new axes based on axes to use
            if (m_UseX)
            {
                //	m_HorizontalVirtualAxis = new RG_CrossPlatformInputManager.VirtualAxis(horizontalAxisName);
                //	RG_CrossPlatformInputManager.RegisterVirtualAxis(m_HorizontalVirtualAxis);
                if (!RG_CrossPlatformInputManager.AxisExists(horizontalAxisName))
                {
                    // if the axis doesnt exist create a new one in cross platform input
                    m_HorizontalVirtualAxis = new RG_CrossPlatformInputManager.VirtualAxis(horizontalAxisName);
                    RG_CrossPlatformInputManager.RegisterVirtualAxis(m_HorizontalVirtualAxis);
                }
                else
                {
                    m_HorizontalVirtualAxis = RG_CrossPlatformInputManager.VirtualAxisReference(horizontalAxisName);
                }
            }
            if (m_UseY)
            {
                //m_VerticalVirtualAxis = new RG_CrossPlatformInputManager.VirtualAxis(verticalAxisName);
                //RG_CrossPlatformInputManager.RegisterVirtualAxis(m_VerticalVirtualAxis);
                if (!RG_CrossPlatformInputManager.AxisExists(verticalAxisName))
                {
                    // if the axis doesnt exist create a new one in cross platform input
                    m_VerticalVirtualAxis = new RG_CrossPlatformInputManager.VirtualAxis(verticalAxisName);
                    RG_CrossPlatformInputManager.RegisterVirtualAxis(m_VerticalVirtualAxis);
                }
                else
                {
                    m_VerticalVirtualAxis = RG_CrossPlatformInputManager.VirtualAxisReference(verticalAxisName);
                }
            }
        }