コード例 #1
0
ファイル: TiltInput.cs プロジェクト: 21411052/BoxShooter
 private void OnEnable()
 {
     if (mapping.type == AxisMapping.MappingType.NamedAxis)
     {
         m_SteerAxis = new CrossPlatformInputManager.VirtualAxis(mapping.axisName);
         CrossPlatformInputManager.RegisterVirtualAxis(m_SteerAxis);
     }
 }
コード例 #2
0
ファイル: createaxes.cs プロジェクト: ASarana/PacManArcada
    public string verticalAxisName = "Vertical"; // название оси вертикали для кросплатформенного ввода

    #endregion Fields

    #region Methods

    void OnEnable()
    {
        //регистрируем оси для работы
        m_HorizontalVirtualAxis = new CrossPlatformInputManager.VirtualAxis(horizontalAxisName);
        CrossPlatformInputManager.RegisterVirtualAxis(m_HorizontalVirtualAxis);

        m_VerticalVirtualAxis = new CrossPlatformInputManager.VirtualAxis(verticalAxisName);
        CrossPlatformInputManager.RegisterVirtualAxis(m_VerticalVirtualAxis);
    }
コード例 #3
0
    void Start()
    {
        rectT = UI_Element.rectTransform;

        InitEventsSystem();
        UpdateRect();

        m_SteerAxis = new UnityStandardAssets.CrossPlatformInput.CrossPlatformInputManager.VirtualAxis("Horizontal");
        UnityStandardAssets.CrossPlatformInput.CrossPlatformInputManager.RegisterVirtualAxis(m_SteerAxis);
    }
コード例 #4
0
ファイル: Joystick.cs プロジェクト: meatybobby/TotemGame
		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)
			{
				if(this.gameObject.name == "JoystickObject")
				{
					if (CrossPlatformInputManager.AxisExists(horizontalAxisNameLeft))
					{
						CrossPlatformInputManager.UnRegisterVirtualAxis(horizontalAxisNameLeft);
					}
					m_HorizontalVirtualAxis = new CrossPlatformInputManager.VirtualAxis(horizontalAxisNameLeft);
					CrossPlatformInputManager.RegisterVirtualAxis(m_HorizontalVirtualAxis);
				}
				else
				{
					if (CrossPlatformInputManager.AxisExists(horizontalAxisNameRight))
					{
						CrossPlatformInputManager.UnRegisterVirtualAxis(horizontalAxisNameRight);
					}
					m_HorizontalVirtualAxis = new CrossPlatformInputManager.VirtualAxis(horizontalAxisNameRight);
					CrossPlatformInputManager.RegisterVirtualAxis(m_HorizontalVirtualAxis);
				}
			}
			if (m_UseY)
			{
				if(this.gameObject.name == "JoystickObject")
				{
					if (CrossPlatformInputManager.AxisExists(verticalAxisNameLeft))
					{
						CrossPlatformInputManager.UnRegisterVirtualAxis(verticalAxisNameLeft);
					}
					m_VerticalVirtualAxis = new CrossPlatformInputManager.VirtualAxis(verticalAxisNameLeft);
					CrossPlatformInputManager.RegisterVirtualAxis(m_VerticalVirtualAxis);
				}
				else
				{
					if (CrossPlatformInputManager.AxisExists(verticalAxisNameRight))
					{
						CrossPlatformInputManager.UnRegisterVirtualAxis(verticalAxisNameRight);
					}
					m_VerticalVirtualAxis = new CrossPlatformInputManager.VirtualAxis(verticalAxisNameRight);
					CrossPlatformInputManager.RegisterVirtualAxis(m_VerticalVirtualAxis);
				}
			}
		}
コード例 #5
0
		CrossPlatformInputManager.VirtualAxis m_Axis; // A reference to the virtual axis as it is in the cross platform input

		void OnEnable()
		{
			if (!CrossPlatformInputManager.AxisExists(axisName))
			{
				// if the axis doesnt exist create a new one in cross platform input
				m_Axis = new CrossPlatformInputManager.VirtualAxis(axisName);
				CrossPlatformInputManager.RegisterVirtualAxis(m_Axis);
			}
			else
			{
				m_Axis = CrossPlatformInputManager.VirtualAxisReference(axisName);
			}
			FindPairedButton();
		}
コード例 #6
0
ファイル: Joystick.cs プロジェクト: LuanPigosso/Blizzard
        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 CrossPlatformInputManager.VirtualAxis(horizontalAxisName);
                CrossPlatformInputManager.RegisterVirtualAxis(m_HorizontalVirtualAxis);
            }

            if (m_UseY){
                m_VerticalVirtualAxis = new CrossPlatformInputManager.VirtualAxis(verticalAxisName);
                CrossPlatformInputManager.RegisterVirtualAxis(m_VerticalVirtualAxis);
            }
        }
コード例 #7
0
ファイル: Joystick.cs プロジェクト: RabbotVR/AR
        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 CrossPlatformInputManager.VirtualAxis(horizontalAxisName);
                CrossPlatformInputManager.RegisterVirtualAxis(m_HorizontalVirtualAxis);
            }
            if (m_UseY)
            {
                m_VerticalVirtualAxis = new CrossPlatformInputManager.VirtualAxis(verticalAxisName);
                CrossPlatformInputManager.RegisterVirtualAxis(m_VerticalVirtualAxis);
            }
        }
コード例 #8
0
        }  // that is literally all this class does

        void CreateVirtualAxes()  // this is called first, this is basically called on start but when its enabled
        {
            // set axes to use
            m_UseX = (axesToUse == AxisOption.Both || axesToUse == AxisOption.OnlyHorizontal);  // that is so crazy that you can do this to a bool, makes sense since a bool is just a fancy if statement
            m_UseY = (axesToUse == AxisOption.Both || axesToUse == AxisOption.OnlyVertical);

            // create new axes based on axes to use
            if (m_UseX)
            // basically-> get then register, just dont get the need for cross platfrom input manager
            {
                m_lookHorizontalVirtualAxis = new CrossPlatformInputManager.VirtualAxis(horizontalAxisName); // dont fully get this, not even a little
                CrossPlatformInputManager.RegisterVirtualAxis(m_lookHorizontalVirtualAxis);                  // aside from the reference this is the entire four lines of CrossPlatformInputManager
            }
            if (m_UseY)
            {
                m_lookVerticalVirtualAxis = new CrossPlatformInputManager.VirtualAxis(verticalAxisName);
                CrossPlatformInputManager.RegisterVirtualAxis(m_lookVerticalVirtualAxis);
            }
        }
コード例 #9
0
        public void RegisterVirtualAxis(CrossPlatformInputManager.VirtualAxis axis)
        {
            // check if we already have an axis with that name and log and error if we do
            if (m_VirtualAxes.ContainsKey(axis.name))
            {
                Debug.LogError("There is already a virtual axis named " + axis.name + " registered.");
            }
            else
            {
                // add any new axes
                m_VirtualAxes.Add(axis.name, axis);

                // if we dont want to match with the input manager setting then revert to always using virtual
                if (!axis.matchWithInputManager)
                {
                    m_AlwaysUseVirtual.Add(axis.name);
                }
            }
        }
コード例 #10
0
        void CreateVirtualAxes()
        {
            // set axes to use
            this.m_UseX = this.axesToUse == AxisOption.Both || this.axesToUse == AxisOption.OnlyHorizontal;
            this.m_UseY = this.axesToUse == AxisOption.Both || this.axesToUse == AxisOption.OnlyVertical;

            // create new axes based on axes to use
            if (this.m_UseX)
            {
                this.m_HorizontalVirtualAxis = new CrossPlatformInputManager.VirtualAxis(this.horizontalAxisName);
                CrossPlatformInputManager.RegisterVirtualAxis(this.m_HorizontalVirtualAxis);
            }

            if (this.m_UseY)
            {
                this.m_VerticalVirtualAxis = new CrossPlatformInputManager.VirtualAxis(this.verticalAxisName);
                CrossPlatformInputManager.RegisterVirtualAxis(this.m_VerticalVirtualAxis);
            }
        }
コード例 #11
0
        // Use this for initialization
        void Start()
        {
            TouchAtlas          = transform.GetComponent <RectTransform>();
            stickOriginPosition = TouchAtlas.anchoredPosition3D;

            if (CrossPlatformInputManager.AxisExists(horizontalAxisName))
            {
                CrossPlatformInputManager.UnRegisterVirtualAxis(horizontalAxisName);
            }
            virtualAxisHorizontal = new CrossPlatformInputManager.VirtualAxis(horizontalAxisName);
            CrossPlatformInputManager.RegisterVirtualAxis(virtualAxisHorizontal);

            if (CrossPlatformInputManager.AxisExists(verticalAxisName))
            {
                CrossPlatformInputManager.UnRegisterVirtualAxis(verticalAxisName);
            }
            virtualAxisVertical = new CrossPlatformInputManager.VirtualAxis(verticalAxisName);
            CrossPlatformInputManager.RegisterVirtualAxis(virtualAxisVertical);
        }
コード例 #12
0
ファイル: Joystick.cs プロジェクト: kaitlynm1/Unity-MK-Task
        void Start()
        {
            m_StartPos = transform.position;

            // Get Player Movement script off Player gameobject
            PlayerMoveScriptRef = Player.GetComponent <CompleteProject.PlayerMovement>();

            if (PlayerMoveScriptRef == null)
            {
                Debug.Log("PlayerMoveScript error: Null");
            }

            // Setting opposing joystick virtual axis references
            if (ID == JoystickID.LeftMovement)
            {
                m_OpposingHVirtualAxis = RightJoyStickScriptRef.m_HorizontalVirtualAxis;
                m_OpposingVVirtualAxis = RightJoyStickScriptRef.m_VerticalVirtualAxis;
            }
        }
コード例 #13
0
        CrossPlatformInputManager.VirtualAxis m_Axis; // A reference to the virtual axis as it is in the cross platform input



        void OnEnable()

        {
            if (!CrossPlatformInputManager.AxisExists(axisName))

            {
                // if the axis doesnt exist create a new one in cross platform input

                m_Axis = new CrossPlatformInputManager.VirtualAxis(axisName);

                CrossPlatformInputManager.RegisterVirtualAxis(m_Axis);
            }

            else

            {
                m_Axis = CrossPlatformInputManager.VirtualAxisReference(axisName);
            }

            FindPairedButton();
        }
コード例 #14
0
        public void RegisterVirtualAxis(CrossPlatformInputManager.VirtualAxis axis)
        {
            // check if we already have an axis with that name and log and error if we do
            if (m_VirtualAxes.ContainsKey(axis.name))
            {
                // Debug.LogError("There is already a virtual axis named " + axis.name + " registered.");

                //so unregister it and register a new one//  - Aaron Hibberd - 12.02.2015 - www.hibbygames.com//
                UnRegisterVirtualAxis(axis.name);
            }
            //else
            //{
            // add any new axes
            m_VirtualAxes.Add(axis.name, axis);

            // if we dont want to match with the input manager setting then revert to always using virtual
            if (!axis.matchWithInputManager)
            {
                m_AlwaysUseVirtual.Add(axis.name);
            }
            //}
        }
コード例 #15
0
 // Token: 0x06000A72 RID: 2674 RVA: 0x0003F0D8 File Offset: 0x0003D4D8
 public static void RegisterVirtualAxis(CrossPlatformInputManager.VirtualAxis axis)
 {
     CrossPlatformInputManager.activeInput.RegisterVirtualAxis(axis);
 }
コード例 #16
0
        public bool ButtonExists(string name) => default;       // 0x000000018062E360-0x000000018062E3C0

        public void RegisterVirtualAxis(CrossPlatformInputManager.VirtualAxis axis)
        {
        }                                                                                      // 0x000000018062E3C0-0x000000018062E4C0
コード例 #17
0
 /**
  * Create the virtual axes for the joystick.
  */
 void CreateVirtualAxes()
 {
     horizontalVirtualAxis = new CrossPlatformInputManager.VirtualAxis(horizontalAxisName);
     verticalVirtualAxis   = new CrossPlatformInputManager.VirtualAxis(verticalAxisName);
 }
コード例 #18
0
 public abstract void RegisterVirtualAxis(CrossPlatformInputManager.VirtualAxis axis);