//------------------------------------------------------------------------- // Unity API //------------------------------------------------------------------------- private void Awake() { director = GetComponentInParent <PlayableDirector>(); gamepad = gameObject.AddComponent <VirtualGamepad>(); VirtualInput input = new VirtualInput(); input.SetGamepad(gamepad); virtualInput = input; }
/// <summary> /// External system function used to actually set the cursor. /// </summary> /// <param name="x">The cursor's x position in screen space.</param> /// <param name="y">The cursor's y position in screen space.</param> public void SetMouseScreenPosition(int x, int y) { VirtualGamepad.SetCursorPos(x, y); }
//------------------------------------------------------------------------- // Public Interface //------------------------------------------------------------------------- /// <summary> /// Set the gamepad to use for collecting inputs. /// </summary> /// <param name="gamepad">The gamepad to use for inputs.</param> public void SetGamepad(VirtualGamepad gamepad) { this.gamepad = gamepad; }