public void RegisterVirtualButton(CrossPlatformInputManager.VirtualButton button)
        {
            // check if already have a buttin with that name and log an error if we do
            if (this.m_VirtualButtons.ContainsKey(button.name))
            {
                Debug.LogError("There is already a virtual button named " + button.name + " registered.");
            }
            else
            {
                // add any new buttons
                this.m_VirtualButtons.Add(button.name, button);

                // if we dont want to match to the input manager then always use a virtual axis
                if (!button.matchWithInputManager)
                {
                    this.m_AlwaysUseVirtual.Add(button.name);
                }
            }
        }
Example #2
0
        // Start is called before the first frame update
        void Start()
        {
            this.ToggleButton = new CrossPlatformInputManager.VirtualButton(this.toogleName);

            CrossPlatformInputManager.RegisterVirtualButton(this.ToggleButton);
        }