![]() |
Adventure Creator 1.84.3
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2024
|
Classes | |
| class | TouchInstance |
Public Member Functions | |
| delegate bool | InputButtonDelegate (string buttonName) |
| delegate float | InputAxisDelegate (string axisName) |
| delegate Vector2 | InputMouseDelegate (bool cusorIsLocked=false) |
| delegate bool | InputMouseButtonDelegate (int button) |
| delegate Vector2 | InputTouchDelegate (int index) |
| delegate TouchPhase | InputTouchPhaseDelegate (int index) |
| delegate int | _InputTouchCountDelegate () |
| delegate DragState | _InputGetDragStateDelegate (DragState currentDragState) |
| void | OnInitGameEngine () |
| void | UpdateInput () |
| void | ClearFreeAimInput () |
| bool | CanDirectControlPlayer () |
| Checks if the Player can be directly-controlled during gameplay. | |
| bool | ClickedRecently (bool checkForDouble=false) |
| Checks if the player clicked within the last few frames. This is useful when checking for input in Actions, because Actions do not run every frame. | |
| Vector2 | GetMousePosition () |
| Gets the cursor's position in screen space. | |
| Vector2 | GetInvertedMouse () |
| Gets the y-inverted cursor position. This is useful because Menu Rects are drawn upwards, while screen space is measured downwards. | |
| void | SetSimulatedCursorPosition (Vector2 newPosition) |
| Sets the position of the simulated cursor, which is used when the game's Input method is set to Keyboard Or Controller. | |
| void | InitialiseCursorLock (MovementMethod movementMethod) |
| Initialises the cursor lock based on a given movement method. | |
| bool | IsCursorReadable () |
| Checks if the cursor's position can be read. This is only ever False if the cursor cannot be dragged on a touch-screen. | |
| void | DetectConversationNumerics () |
| void | DetectConversationInputs () |
| void | DrawDragLine () |
| void | UpdateDirectInput (bool isInGameplay) |
| void | BeginCameraLockSnap () |
| bool | IsCameraLockSnapped () |
| void | FlashHotspots () |
| void | RemoveActiveArrows () |
| void | ResetClick () |
| bool | CanClick () |
| Checks if a mouse click will be registered. | |
| bool | CanDoubleClick () |
| Checks if a mouse double-click will be registered. | |
| void | SimulateInputButton (string button) |
| Simulates the pressing of an Input button. | |
| void | SimulateInputAxis (string axis, float value) |
| Simulates the pressing of an Input axis. | |
| void | SimulateInput (SimulateInputType inputType, string name, float value) |
| Simulates the pressing of an Input button or axis. | |
| bool | IsCursorLocked () |
| Checks if the cursor is locked. | |
| bool | InputAnyKeyDown () |
| Checks if any input button is currently being pressed, simulated or otherwise. | |
| float | InputGetAxis (string axis) |
| Replaces "Input.GetAxis", allowing for custom overrides. | |
| TouchPhase | InputTouchPhase (int index) |
| int | InputTouchCount () |
| bool | InputGetButton (string axis) |
| Replaces "Input.GetButton", allowing for custom overrides. | |
| bool | InputGetButtonDown (string axis, bool showError=false) |
| Replaces "Input.GetButton", allowing for custom overrides. | |
| bool | InputGetButtonUp (string axis) |
| Replaces "Input.GetButtonUp". | |
| void | EnforcePreInventoryDragState () |
| TouchInstance | GetTouchInstance (int index) |
| void | _FixedUpdate () |
| void | LetGo () |
| HeldObjectData | GetHeldObjectData (DragBase dragBase) |
| Gets the data related to the holding of a draggable object. | |
| HeldObjectData[] | GetHeldObjectData () |
| Vector2 | GetDragVector () |
| Gets the drag vector. | |
| bool | ActiveArrowsDisablingHotspots () |
| Checks if the active ArrowPrompt prevents Hotspots from being interactive. | |
| void | ToggleCursor () |
| void | SetInGameCursorState (bool lockState) |
| Sets the lock state of the in-game cursor manually. When locked, the cursor will be placed in the centre of the screen during gameplay. | |
| bool | GetInGameCursorState () |
| Gets the locked state of the cursor during gameplay (i.e. when the game is not paused). | |
| bool | IsDragObjectHeld (DragBase _dragBase) |
| Checks if a specific DragBase object is being held by the player. | |
| bool | IsDragObjectHeld () |
| Checks if any DragBase object is being held by the player. | |
| float | GetDragMovementSlowDown () |
| Gets the factor by which Player movement is slowed when holding a DragBase object. | |
| void | SetTimeScale (float _timeScale, bool affectFixedDeltaTime) |
| Sets the timeScale. | |
| void | SetTimeCurve (AnimationCurve _timeCurve, bool _timeCurveAffectsFixedDeltaTime=false) |
| Assigns an AnimationCurve that controls the timeScale over time. | |
| bool | HasTimeCurve () |
| Checks if time is being controlled by an AnimationCurve. | |
| DragState | GetDragState () |
| Get what kind of object is currently being dragged (None, Player, Inventory, Menu, ScreenArrows, Moveable, _Camera). | |
| MouseState | GetMouseState (bool forScene=true) |
| Gets the current state of the mouse buttons (Normal, SingleClick, RightClick, DoubleClick, HeldDown, LetGo). | |
| void | ResetMouseClick () |
| Vector2 | GetMoveKeys () |
| Gets the input movement as a vector. | |
| bool | IsPlayerControlledRunning () |
| Checks if the Player is running due to user-controlled input. | |
| void | SetActiveDragElement (MenuDrag menuDrag) |
| Assigns a MenuDrag element as the one to drag. | |
| bool | LastClickWasDouble () |
| Checks if the last mouse click made was a double-click. | |
| void | ResetDragMovement () |
| bool | IsDragMoveSpeedOverWalkThreshold () |
| Checks if the magnitude of "Drag" Player input is above the minimum needed to move the Player. | |
| bool | IsMouseOnScreen () |
| Checks if the cursor's position is within the boundary of the screen. | |
| Vector2 | GetFreeAim () |
| Gets the free-aim input vector. | |
| void | OnLoad () |
| MainData | SaveMainData (MainData mainData) |
| Updates a MainData class with its own variables that need saving. | |
| void | LoadMainData (MainData mainData) |
| Updates its own variables from a MainData class. | |
| virtual void | InputControlMenu (Menu menu) |
| Controls an OnGUI-based Menu with keyboard or Controller inputs. | |
| IEnumerator | DelayConversation (Conversation conversation, System.Action callback) |
| void | EndConversation () |
| void | DrawStatus () |
| bool | IsInConversation (bool alsoPendingOption=false) |
| Checks if a Conversation is currently active. | |
| void | OverrideLockedCursorPosition (Vector2 position) |
| Enforces a custom position (in screen coordinates) to apply to the cursor when it is locked. | |
| void | ReleaseLockedCursorPositionOverride () |
| Vector3 | GetDragForce (DragBase dragBase) |
Protected Member Functions | |
| void | SetDoubleClickState () |
| void | UpdateActiveInputs () |
| void | DetectCursorInputs () |
| void | UpdateDragLine () |
| Vector2 | CreateMoveKeys (float h, float v) |
| void | ResetDoubleClick () |
| float | InputGetAxisRaw (string axis) |
| bool | InputGetMouseButton (int button) |
| Vector2 | InputMousePosition (bool _cursorIsLocked) |
| Vector2 | InputTouchPosition (int index) |
| Vector2 | InputTouchDeltaPosition (int index) |
| Vector2 | InputGetFreeAim (bool _cursorIsLocked, float scaleFactor=1f) |
| bool | InputGetMouseButtonDown (int button) |
| void | SetDragState (bool twoTouches=false) |
| void | UpdateDrag () |
| void | AttemptGrab () |
| void | OnGrabMoveable (DragBase dragBase) |
| void | OnDropMoveable (DragBase dragBase) |
| float | GetDeltaTime () |
| virtual Vector2 | GetSmoothFreeAim (Vector2 targetFreeAim) |
Protected Attributes | |
| float | changeTimeStart |
| MouseState | mouseState = MouseState.Normal |
| DragState | dragState = DragState.None |
| Vector2 | moveKeys = new Vector2 (0f, 0f) |
| bool | playerIsControlledRunning = false |
| float | defaultFixedDeltaTime |
| AnimationCurve | timeCurve |
| bool | timeCurveAffectsFixedDeltaTime |
| float | clickTime = 0f |
| float | doubleClickTime = 0 |
| MenuDrag | activeDragElement |
| bool | hasUnclickedSinceClick = false |
| bool | lastClickWasDouble = false |
| float | lastclickTime = 0f |
| Vector2 | xboxCursor |
| Vector2 | mousePosition |
| bool | scrollingLocked = false |
| bool | canCycleInteractionInput = true |
| Vector2 | dragStartPosition = Vector2.zero |
| Vector2 | dragEndPosition = Vector2.zero |
| float | dragSpeed = 0f |
| Vector2 | dragVector |
| float | touchTime = 0f |
| float | touchThreshold = 0.2f |
| TouchInstance[] | touchInstances = new TouchInstance[10] |
| Vector2 | freeAim |
| bool | toggleCursorOn = false |
| bool | cursorIsLocked = false |
| bool | canDragMoveable = false |
| List< HeldObjectData > | heldObjectDatas = new List<HeldObjectData>() |
| bool | pickUpIsHeld |
| bool | draggableIsHeld |
| Vector2 | lastMousePosition |
| Vector2 | unconstrainedMousePosition |
| bool | resetMouseDelta = false |
| Vector3 | lastCameraPosition |
| Vector2 | deltaDragMouse |
| Conversation | pendingOptionConversation = null |
| bool | mouseIsOnScreen = true |
| LerpUtils.Vector2Lerp | freeAimLerp = new LerpUtils.Vector2Lerp () |
Properties | |
| Conversation | PendingOptionConversation [get, set] |
| virtual Vector2 | LockedCursorPosition [get] |
| bool | CanKeyboardControlMenusDuringGameplay [get, set] |
This script recieves and processes all input, for use by other scripts. It should be placed on the GameEngine prefab.
| delegate DragState AC.PlayerInput._InputGetDragStateDelegate | ( | DragState | currentDragState | ) |
A delegate template for overriding the drag state calculation
| delegate int AC.PlayerInput._InputTouchCountDelegate | ( | ) |
A delegate template for overriding touch count
| bool AC.PlayerInput.ActiveArrowsDisablingHotspots | ( | ) |
Checks if the active ArrowPrompt prevents Hotspots from being interactive.
| bool AC.PlayerInput.CanClick | ( | ) |
Checks if a mouse click will be registered.
| bool AC.PlayerInput.CanDirectControlPlayer | ( | ) |
| bool AC.PlayerInput.CanDoubleClick | ( | ) |
Checks if a mouse double-click will be registered.
| void AC.PlayerInput.ClearFreeAimInput | ( | ) |
Resets the free-aim input instantly
| bool AC.PlayerInput.ClickedRecently | ( | bool | checkForDouble = false | ) |
Checks if the player clicked within the last few frames. This is useful when checking for input in Actions, because Actions do not run every frame.
| checkForDouble | If True, then the check will be made for a double-click, rather than a single-click. |
| void AC.PlayerInput.DetectConversationInputs | ( | ) |
Detects the pressing of the defined input buttons if they can be used to trigger a Conversation's dialogue options.
| void AC.PlayerInput.DetectConversationNumerics | ( | ) |
Detects the pressing of the numeric keys if they can be used to trigger a Conversation's dialogue options.
| void AC.PlayerInput.DrawDragLine | ( | ) |
Draws a drag-line on screen if the chosen movement method allows for one.
| void AC.PlayerInput.DrawStatus | ( | ) |
Displays input-related information for the AC Status window
| void AC.PlayerInput.EndConversation | ( | ) |
Ends the active Conversation.
| void AC.PlayerInput.FlashHotspots | ( | ) |
Invokes the 'Flash' function on all enabled Hotspots that the Player can interact with
| float AC.PlayerInput.GetDragMovementSlowDown | ( | ) |
| DragState AC.PlayerInput.GetDragState | ( | ) |
| Vector2 AC.PlayerInput.GetDragVector | ( | ) |
Gets the drag vector.
| Vector2 AC.PlayerInput.GetFreeAim | ( | ) |
Gets the free-aim input vector.
| HeldObjectData[] AC.PlayerInput.GetHeldObjectData | ( | ) |
Gets all data related to the draggable objects currently being held.
| HeldObjectData AC.PlayerInput.GetHeldObjectData | ( | DragBase | dragBase | ) |
Gets the data related to the holding of a draggable object.
| dragBase | The draggable object to get data for |
| bool AC.PlayerInput.GetInGameCursorState | ( | ) |
Gets the locked state of the cursor during gameplay (i.e. when the game is not paused).
| Vector2 AC.PlayerInput.GetInvertedMouse | ( | ) |
| Vector2 AC.PlayerInput.GetMousePosition | ( | ) |
Gets the cursor's position in screen space.
| MouseState AC.PlayerInput.GetMouseState | ( | bool | forScene = true | ) |
Gets the current state of the mouse buttons (Normal, SingleClick, RightClick, DoubleClick, HeldDown, LetGo).
| forScene | If True, then SingleClick will swapped with LetGo, allowing for clicks to register upon release, should the current input settings allow for it |
| Vector2 AC.PlayerInput.GetMoveKeys | ( | ) |
Gets the input movement as a vector.
| bool AC.PlayerInput.HasTimeCurve | ( | ) |
Checks if time is being controlled by an AnimationCurve.
| void AC.PlayerInput.InitialiseCursorLock | ( | MovementMethod | movementMethod | ) |
Initialises the cursor lock based on a given movement method.
| movementMethod | The new movement method |
| bool AC.PlayerInput.InputAnyKeyDown | ( | ) |
Checks if any input button is currently being pressed, simulated or otherwise.
| delegate float AC.PlayerInput.InputAxisDelegate | ( | string | axisName | ) |
A delegate template for overriding input axis detection
| delegate bool AC.PlayerInput.InputButtonDelegate | ( | string | buttonName | ) |
A delegate template for overriding input button detection
|
virtual |
| float AC.PlayerInput.InputGetAxis | ( | string | axis | ) |
Replaces "Input.GetAxis", allowing for custom overrides.
| axis | The Input axis to detect |
| bool AC.PlayerInput.InputGetButton | ( | string | axis | ) |
Replaces "Input.GetButton", allowing for custom overrides.
| axis | The Input button to detect |
| bool AC.PlayerInput.InputGetButtonDown | ( | string | axis, |
| bool | showError = false ) |
Replaces "Input.GetButton", allowing for custom overrides.
| axis | The Input button to detect |
| showError | If True, then an error message will appear in the Console window if the button is not defined in the Input manager |
| bool AC.PlayerInput.InputGetButtonUp | ( | string | axis | ) |
Replaces "Input.GetButtonUp".
| axis | The Input button to detect |
| delegate bool AC.PlayerInput.InputMouseButtonDelegate | ( | int | button | ) |
A delegate template for overriding mouse button detection
| delegate Vector2 AC.PlayerInput.InputMouseDelegate | ( | bool | cusorIsLocked = false | ) |
A delegate template for overriding mouse position detection
| delegate Vector2 AC.PlayerInput.InputTouchDelegate | ( | int | index | ) |
A delegate template for overriding touch position detection
| delegate TouchPhase AC.PlayerInput.InputTouchPhaseDelegate | ( | int | index | ) |
A delegate template for overriding touch phase
| bool AC.PlayerInput.IsCameraLockSnapped | ( | ) |
| bool AC.PlayerInput.IsCursorLocked | ( | ) |
Checks if the cursor is locked.
| bool AC.PlayerInput.IsCursorReadable | ( | ) |
Checks if the cursor's position can be read. This is only ever False if the cursor cannot be dragged on a touch-screen.
| bool AC.PlayerInput.IsDragMoveSpeedOverWalkThreshold | ( | ) |
| bool AC.PlayerInput.IsDragObjectHeld | ( | ) |
| bool AC.PlayerInput.IsDragObjectHeld | ( | DragBase | _dragBase | ) |
| bool AC.PlayerInput.IsInConversation | ( | bool | alsoPendingOption = false | ) |
Checks if a Conversation is currently active.
| alsoPendingOption | If True, then the method will return True if a Conversation is not active, but is in the delay gap between choosing an option and running it |
| bool AC.PlayerInput.IsMouseOnScreen | ( | ) |
Checks if the cursor's position is within the boundary of the screen.
| bool AC.PlayerInput.IsPlayerControlledRunning | ( | ) |
| bool AC.PlayerInput.LastClickWasDouble | ( | ) |
Checks if the last mouse click made was a double-click.
| void AC.PlayerInput.LetGo | ( | ) |
Forces the letting-go of the currently-held DragBase, if set.
| void AC.PlayerInput.LoadMainData | ( | MainData | mainData | ) |
| void AC.PlayerInput.OnLoad | ( | ) |
Resets the mouse and assigns the correct gameState in StateHandler after loading a save game.
| void AC.PlayerInput.OverrideLockedCursorPosition | ( | Vector2 | position | ) |
Enforces a custom position (in screen coordinates) to apply to the cursor when it is locked.
| position | The position (in screen coordinates) |
| void AC.PlayerInput.ReleaseLockedCursorPositionOverride | ( | ) |
Releases the custom locked cursor position set with OverrideLockedCursorPosition
| void AC.PlayerInput.RemoveActiveArrows | ( | ) |
Disables the active ArrowPrompt.
| void AC.PlayerInput.ResetClick | ( | ) |
Records the current click time, so that another click will not register for the duration of clickDelay.
| void AC.PlayerInput.ResetDragMovement | ( | ) |
Resets the speed of "Drag" Player input.
| void AC.PlayerInput.ResetMouseClick | ( | ) |
Resets the mouse click so that nothing else will be affected by it this frame.
| void AC.PlayerInput.SetActiveDragElement | ( | MenuDrag | menuDrag | ) |
| void AC.PlayerInput.SetInGameCursorState | ( | bool | lockState | ) |
Sets the lock state of the in-game cursor manually. When locked, the cursor will be placed in the centre of the screen during gameplay.
| lockState | If True, the cursor will be locked during gameplay |
| void AC.PlayerInput.SetSimulatedCursorPosition | ( | Vector2 | newPosition | ) |
Sets the position of the simulated cursor, which is used when the game's Input method is set to Keyboard Or Controller.
| newPosition | The position, in screen-space co-ordinates, to move the simulated cursor to<param> |
| void AC.PlayerInput.SetTimeCurve | ( | AnimationCurve | _timeCurve, |
| bool | _timeCurveAffectsFixedDeltaTime = false ) |
Assigns an AnimationCurve that controls the timeScale over time.
| _timeCurve | The AnimationCurve to use |
| _timeCurveAffectsFixedDeltaTime | If True, Time.fixedDeltaTime will be affected as well |
| void AC.PlayerInput.SetTimeScale | ( | float | _timeScale, |
| bool | affectFixedDeltaTime ) |
Sets the timeScale.
| _timeScale | The new timeScale. A negative value will have no effect<param> |
| void AC.PlayerInput.SimulateInput | ( | SimulateInputType | inputType, |
| string | name, | ||
| float | value ) |
Simulates the pressing of an Input button or axis.
| inputType | The type of Input this is simulating (Button, Axis) |
| name | The name of the Input button or axis |
| value | The value to assign the Input axis, if input = SimulateInputType.Axis |
| void AC.PlayerInput.SimulateInputAxis | ( | string | axis, |
| float | value ) |
Simulates the pressing of an Input axis.
| axis | The name of the Input axis |
| value | The value to assign the Input axis |
| void AC.PlayerInput.SimulateInputButton | ( | string | button | ) |
Simulates the pressing of an Input button.
| button | The name of the Input button |
| void AC.PlayerInput.UpdateDirectInput | ( | bool | isInGameplay | ) |
Updates the input variables needed for Direct movement. This is called every frame by StateHandler.
| void AC.PlayerInput.UpdateInput | ( | ) |
Updates the input handler. This is called every frame by StateHandler.
| ArrowPrompt AC.PlayerInput.activeArrows = null |
The active ArrowPrompt
| Conversation AC.PlayerInput.activeConversation = null |
The active Conversation
| bool AC.PlayerInput.canKeyboardControlMenusDuringGameplay = false |
If True, Menus can be controlled via the keyboard or controller during gameplay
| float AC.PlayerInput.clickDelay = 0.3f |
The minimum duration, in seconds, that can elapse between mouse clicks
| float AC.PlayerInput.doubleClickDelay = 1f |
The maximum duration, in seconds, between two successive mouse clicks to register a "double-click"
| string AC.PlayerInput.dragOverrideInput = "" |
The name of the Input Axis that controls dragging effects. If empty, the default inputs (LMB / "InteractionA") will be used
| InputAxisDelegate AC.PlayerInput.InputGetAxisDelegate = null |
A delegate for the InputGetAxis function, used to detect the value of an input axis
| InputButtonDelegate AC.PlayerInput.InputGetButtonDelegate = null |
A delegate for the InputGetButton function, used to detect when a button is held down
| InputButtonDelegate AC.PlayerInput.InputGetButtonDownDelegate = null |
A delegate for the InputGetButtonDown function, used to detect when a button is first pressed
| InputButtonDelegate AC.PlayerInput.InputGetButtonUpDelegate = null |
A delegate for the InputGetButtonUp function, used to detect when a button is released
| _InputGetDragStateDelegate AC.PlayerInput.InputGetDragStateDelegate |
A delegate for _InputGetDragStateDelegate, used to update the drag state
| InputMouseDelegate AC.PlayerInput.InputGetFreeAimDelegate |
A delegate for the InputGetFreeAim function, used to get the free-aiming vector
| InputMouseButtonDelegate AC.PlayerInput.InputGetMouseButtonDelegate |
A delegate for the InputGetMouseButton function, used to detect mouse clicks
| InputMouseButtonDelegate AC.PlayerInput.InputGetMouseButtonDownDelegate |
A delegate for the InputGetMouseDownButton function, used to detect when a mouse button is first clicked
| InputTouchPhaseDelegate AC.PlayerInput.InputGetTouchPhaseDelegate |
A delegate for the InputTouchPhase function, used to detect a touch index's phase
| InputMouseDelegate AC.PlayerInput.InputMousePositionDelegate |
A delegate for the InputMousePosition function, used to detect the mouse position
| _InputTouchCountDelegate AC.PlayerInput.InputTouchCountDelegate |
A delegate for _InputTouchCountDelegate, used to get the number of touches
| InputTouchDelegate AC.PlayerInput.InputTouchDeltaPositionDelegate |
A delegate for the InputTouchPosition function, used to detect the touch deltaPosition
| InputTouchDelegate AC.PlayerInput.InputTouchPositionDelegate |
A delegate for the InputTouchPosition function, used to detect the touch position
| string AC.PlayerInput.skipMovieKey = "" |
The name of the Input button that skips movies played with ActionMove
| float AC.PlayerInput.timeScale = 1f |
The game's current Time.timeScale value
|
getset |
If True, Menus can be controlled via the keyboard or controller during gameplay
|
get |
The position of the cursor when it is locked
|
getset |
A Conversation that has ended, but has yet to run the response