Adventure Creator
1.81.2
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2024
|
Public Member Functions | |
void | SetAsActive () |
void | SetAsInactive () |
void | RunInteraction (AC.Button button) |
Runs an Interaction associated with the Hotspot More... | |
void | RunExamineInteraction () |
void | RunUseInteraction (int iconID=-1) |
Runs one of the Hotspot's 'Use' interactions. More... | |
void | RunInventoryInteraction (int invID=-1) |
Runs one of the Hotspot's 'Inventory' interactions. More... | |
void | RunInventoryInteraction (InvItem invItem=null) |
Runs one of the Hotspot's 'Inventory' interactions. More... | |
void | RunInventoryInteraction (InvInstance invInstance=null) |
Runs one of the Hotspot's 'Inventory' interactions. More... | |
void | SetProximity (bool isGameplay) |
Highlights the Hotspot based on the mouse cursor's proximity. More... | |
bool | UpgradeSelf () |
Upgrades the Hotspot from a previous version of Adventure Creator. More... | |
void | DrawHotspotIcon (bool inWorldSpace=false) |
Draws an icon at the Hotspot's centre. More... | |
string | GetFullLabel (int languageNumber=0, int cursorID=-1) |
Gets the label to display when the cursor is over this Hotspot, with cursor names and active inventory item included if appropriate. More... | |
void | UpdateIcon () |
void | UpdateProximity (DetectHotspots detectHotspots) |
Sets the layer of the Hotspot according to whether or not it is within the proximity of a Hotspot detector. More... | |
bool | UpdateUnhandledVisibility () |
Sets the layer of the Hotspot according to whether or not it has a "Use" interaction for the currently-selected cursor More... | |
void | SetIconVisibility (bool makeVisible, float speed=5f) |
Shows or hides the Hotspot's associated icon, provided that the Settings Manager's hotspotIconDisplay = HotspotIconDisplay.ViaScriptOnly More... | |
Button | GetFirstUseButton () |
Gets the Button that represents the first-available "Use" interaction. More... | |
int | GetFirstUseIcon () |
Gets the ID of the icon that represents the first-available "Use" interaction. More... | |
Button | GetUseButton (int iconID) |
Gets the Button that represents the first-available "Use" interaction associated with a given interaction icon. More... | |
Button | GetInvButton (int invID) |
Gets the Button that represents the first-available "Inventory" interaction associated with a given inventory item. More... | |
HotspotInteractionType | GetButtonInteractionType (Button _button) |
Gets the interaction type of a given Button, provided it is defined by the Hotspot More... | |
int | FindFirstEnabledInteraction () |
Gets the index number of the Button that represents the first-available "Use" interaction. More... | |
void | TurnOn () |
Enables the Hotspot. More... | |
void | SetButtonState (Button button, bool isEnabled) |
Updates the enabled state of one of the Hotspot's Buttons More... | |
void | OnExitPlayerVicinityMode () |
virtual void | TurnOn (bool manualSet) |
Enables the Hotspot. More... | |
void | TurnOff () |
virtual void | TurnOff (bool manualSet) |
Disables the Hotspot. More... | |
virtual bool | IsOn () |
Checks if the Hotspot is enabled or not. More... | |
bool | PlayerIsWithinBoundary () |
Checks if the Player is within the Hotspot's interactableBoundary, if assigned. More... | |
void | Select () |
void | Deselect () |
void | Flash () |
void | DeselectInstant () |
void | ShowInteractionMenus () |
void | ShowInteractionMenu (Menu menu, bool includeInventoryItems) |
Turns on a specific Menu, linking any Interaction icons in it to the Hotspot. The Menu doesn't need to have an appearType of AppearType.OnInteraction. More... | |
bool | IsSingleInteraction () |
Checks if oneClick = True, and the Hotspot has at least one "Use" interaction defined. More... | |
bool | HasInventoryInteraction (InvItem invItem) |
Checks if the Hotspot has an active interaction for a given inventory item, or a generic unhandled inventory interaction. More... | |
Vector2 | GetIconScreenPosition () |
Gets the position of the Hotspot's icon, in Screen Space. More... | |
virtual Vector3 | GetIconPosition (bool inLocalSpace=false) |
Gets the position of the Hotspot's icon More... | |
virtual Vector3 | GetFacingPosition (bool inLocalSpace=false) |
The Hotspot's facing position More... | |
void | ResetMainIcon () |
int | GetPreviousInteraction (int i, int numInvInteractions) |
Gets the previous interaction index. More... | |
int | GetPreviousInteraction (int i) |
int | GetActiveInvButtonID () |
void | RestoreInteraction () |
string | GetName (int languageNumber) |
Gets the Hotspot's current display name. More... | |
void | SetName (string newName, int _lineID) |
Renames the Hotspot mid-game. More... | |
bool | HasContextUse () |
Checks if the Hotspot has at least one "Use" interaction defined. More... | |
bool | HasContextLook () |
Checks if the Hotspot has at least one "Examine" interaction defined. More... | |
int | GetNextInteraction (int i, int numInvInteractions) |
Gets the next interaction index. More... | |
int | GetNextInteraction (int i) |
MatchingInvInteractionData | GetMatchingInvInteractionData (bool rebuild) |
override string | ToString () |
CursorIcon | GetMainIcon () |
Gets the Hotspot's "main" icon, which refers to the first-found interaction icon associated with the Hotspot. More... | |
int | GetNumItemReferences (int itemID) |
int | UpdateItemReferences (int oldItemID, int newItemID) |
string | GetTranslatableString (int index) |
Gets the text to be translated, given its index. More... | |
int | GetTranslationID (int index) |
Gets the translation ID of a given text index. More... | |
AC_TextType | GetTranslationType (int index) |
Gets the translation type of a given text index. More... | |
void | UpdateTranslatableString (int index, string updatedText) |
int | GetNumTranslatables () |
Gets the maximum number of possible translatable texts. More... | |
bool | HasExistingTranslation (int index) |
Checks if a given text index has already been assigned a unique translation ID. More... | |
void | SetTranslationID (int index, int _lineID) |
Sets the translation ID of a given text index More... | |
string | GetOwner (int index) |
Gets the name of the translatable text's owner. In the case of speech text, it is the name of the character. In the case of menu element text, it is the name of the menu element. More... | |
bool | OwnerIsPlayer (int index) |
Checks if the translatable text's owner is a Player. This is necessary for speech lines, since multiple player prefabs can feasibly share the same line. More... | |
bool | CanTranslate (int index) |
Checks if a given text index can and should be translated. More... | |
bool | ReferencesAsset (ActionListAsset actionListAsset) |
List< ActionListAsset > | GetReferencedActionListAssets () |
Public Attributes | |
AC.InteractionSource | interactionSource |
InteractiveBoundary | interactiveBoundary = null |
string | hotspotName |
int | lineID = -1 |
Highlight | highlight |
Marker | walkToMarker |
Transform | centrePoint |
CentrePointOverrides | centrePointOverrides = CentrePointOverrides.FacingAndIconPosition |
bool | provideUseInteraction |
List< Button > | useButtons = new List<Button>() |
bool | oneClick = false |
bool | provideLookInteraction |
Button | lookButton = new Button() |
bool | provideInvInteraction |
List< Button > | invButtons = new List<Button>() |
bool | provideUnhandledUseInteraction |
bool | provideUnhandledInvInteraction |
Button | unhandledUseButton = new Button() |
Button | unhandledInvButton = new Button() |
bool | canBeLowerCase = false |
bool | drawGizmos = true |
int | lastInteractionIndex = 0 |
int | displayLineID = -1 |
string | iconSortingLayer = "" |
int | iconSortingOrder = 0 |
DoubleClickingHotspot | doubleClickingHotspot = DoubleClickingHotspot.MakesPlayerRun |
bool | playerTurnsHead = true |
Protected Member Functions | |
void | Awake () |
void | Start () |
void | OnEnable () |
void | OnDisable () |
void | OnSwitchCamera (_Camera oldCamera, _Camera newCamera, float transitionTime) |
void | OnChangeLanguage (int language) |
void | UpdateLabel (int languageNumber) |
void | LimitToActiveCamera (_Camera _camera) |
void | FindFirstInteractionIndex () |
void | PlaceOnDistantLayer () |
void | PlaceOnHotspotLayer () |
bool | CanDisplayHotspotIcon () |
void | GenerateMainIcon () |
int | FindLastEnabledInteraction (int numInvInteractions) |
bool | HasEnabledUseInteraction (int _iconID) |
bool | HasEnabledInvInteraction (int _itemID) |
int | GetNumInteractions (int numInvInteractions) |
string | GetLabelPrefix (int languageNumber=0, int cursorID=-1) |
void | OnDrawGizmos () |
void | OnDrawGizmosSelected () |
void | DrawGizmos () |
Protected Attributes | |
Collider | _collider |
Collider2D | _collider2D |
bool | isOn = true |
float | iconAlpha = 0 |
Sprite | iconSprite = null |
SpriteRenderer | iconRenderer = null |
CursorIcon | mainIcon |
LerpUtils.FloatLerp | iconAlphaLerp = new LerpUtils.FloatLerp (true) |
float | manualShowIconSpeed = 5f |
bool | manuallyShowIcon = false |
bool | tooFarAway = false |
MatchingInvInteractionData | matchingInvInteractionData |
Properties | |
_Camera | limitToCamera [get, set] |
Transform | Transform [get] |
Collider | Collider [get] |
This component provides the player with a region of space in the scene that can be interacted with. Data for each interaction is stored within the Button class, and this component stores them in Lists. The number of interactions, and how exactly they are triggered, are determined in SettingsManager.
bool AC.Hotspot.CanTranslate | ( | int | index | ) |
Checks if a given text index can and should be translated.
index | The index of the translatable text |
Implements AC.ITranslatable.
void AC.Hotspot.Deselect | ( | ) |
De-selects the Hotspot.
void AC.Hotspot.DeselectInstant | ( | ) |
De-selects the Hotspot instantly.
void AC.Hotspot.DrawHotspotIcon | ( | bool | inWorldSpace = false | ) |
Draws an icon at the Hotspot's centre.
inWorldSpace | If True, the icon shall be drawn as a sprite in world space, as opposed to an OnGUI graphic in screen space. |
int AC.Hotspot.FindFirstEnabledInteraction | ( | ) |
void AC.Hotspot.Flash | ( | ) |
Invokes the Hotspot's flashing effect
HotspotInteractionType AC.Hotspot.GetButtonInteractionType | ( | Button | _button | ) |
|
virtual |
Button AC.Hotspot.GetFirstUseButton | ( | ) |
int AC.Hotspot.GetFirstUseIcon | ( | ) |
Gets the ID of the icon that represents the first-available "Use" interaction.
string AC.Hotspot.GetFullLabel | ( | int | languageNumber = 0 , |
int | cursorID = -1 |
||
) |
Gets the label to display when the cursor is over this Hotspot, with cursor names and active inventory item included if appropriate.
languageNumber | The index number of the language to return the line in, where 0 = the game's original language. |
cursorID | The ID number of the cursor icon (set in the Cursor Manager) to get the label for. If <0, the active cursor will be used. |
|
virtual |
Vector2 AC.Hotspot.GetIconScreenPosition | ( | ) |
Button AC.Hotspot.GetInvButton | ( | int | invID | ) |
Gets the Button that represents the first-available "Inventory" interaction associated with a given inventory item.
invID | The ID number of the associated inventory item, as defined in the Inventory Manager. |
CursorIcon AC.Hotspot.GetMainIcon | ( | ) |
string AC.Hotspot.GetName | ( | int | languageNumber | ) |
int AC.Hotspot.GetNextInteraction | ( | int | i, |
int | numInvInteractions | ||
) |
Gets the next interaction index.
i | The current interaction index |
numInvInteractions | The number of relevant "Inventory" interactions that match the current cursor |
int AC.Hotspot.GetNumTranslatables | ( | ) |
Gets the maximum number of possible translatable texts.
Implements AC.ITranslatable.
string AC.Hotspot.GetOwner | ( | int | index | ) |
Gets the name of the translatable text's owner. In the case of speech text, it is the name of the character. In the case of menu element text, it is the name of the menu element.
index | The index of the translatable text |
Implements AC.ITranslatable.
int AC.Hotspot.GetPreviousInteraction | ( | int | i, |
int | numInvInteractions | ||
) |
Gets the previous interaction index.
i | The current interaction index |
numInvInteractions | The number of relevant "Inventory" interactions that match the current cursor |
string AC.Hotspot.GetTranslatableString | ( | int | index | ) |
Gets the text to be translated, given its index.
index | The index of the translatable text |
Implements AC.ITranslatable.
int AC.Hotspot.GetTranslationID | ( | int | index | ) |
Gets the translation ID of a given text index.
index | The index of the translatable text |
Implements AC.ITranslatable.
AC_TextType AC.Hotspot.GetTranslationType | ( | int | index | ) |
Gets the translation type of a given text index.
index | The index of the translatable text |
Implements AC.ITranslatable.
Button AC.Hotspot.GetUseButton | ( | int | iconID | ) |
Gets the Button that represents the first-available "Use" interaction associated with a given interaction icon.
iconID | The ID number of the associated interaction icon, as defined in the Cursor Manager. |
bool AC.Hotspot.HasContextLook | ( | ) |
bool AC.Hotspot.HasContextUse | ( | ) |
bool AC.Hotspot.HasExistingTranslation | ( | int | index | ) |
Checks if a given text index has already been assigned a unique translation ID.
index | The index of the translatable text |
Implements AC.ITranslatable.
bool AC.Hotspot.HasInventoryInteraction | ( | InvItem | invItem | ) |
|
virtual |
bool AC.Hotspot.IsSingleInteraction | ( | ) |
void AC.Hotspot.OnExitPlayerVicinityMode | ( | ) |
Corrects the Hotspot's state after exiting "Player Vicinity" Hotspot detection mode. This is called automatically by PlayerInteraction
bool AC.Hotspot.OwnerIsPlayer | ( | int | index | ) |
Checks if the translatable text's owner is a Player. This is necessary for speech lines, since multiple player prefabs can feasibly share the same line.
index | The index of the translatable text |
Implements AC.ITranslatable.
bool AC.Hotspot.PlayerIsWithinBoundary | ( | ) |
void AC.Hotspot.ResetMainIcon | ( | ) |
void AC.Hotspot.RunExamineInteraction | ( | ) |
Runs the Hotspot's 'Examine' interaction, if one is defined.
void AC.Hotspot.RunInteraction | ( | AC.Button | button | ) |
Runs an Interaction associated with the Hotspot
button | The Interaction's Button class |
void AC.Hotspot.RunInventoryInteraction | ( | int | invID = -1 | ) |
void AC.Hotspot.RunInventoryInteraction | ( | InvInstance | invInstance = null | ) |
void AC.Hotspot.RunInventoryInteraction | ( | InvItem | invItem = null | ) |
void AC.Hotspot.RunUseInteraction | ( | int | iconID = -1 | ) |
Runs one of the Hotspot's 'Use' interactions.
iconID | The ID number of the CursorIcon associated with the Button. If no number is supplied, the first enabled Use interaction will be run. |
void AC.Hotspot.Select | ( | ) |
Selects the Hotspot.
void AC.Hotspot.SetAsActive | ( | ) |
Registers this as the active Hotspot in the PlayerInteraction script
void AC.Hotspot.SetAsInactive | ( | ) |
Unregisters this as the active Hotspot in the PlayerInteraction script
void AC.Hotspot.SetButtonState | ( | Button | button, |
bool | isEnabled | ||
) |
void AC.Hotspot.SetIconVisibility | ( | bool | makeVisible, |
float | speed = 5f |
||
) |
Shows or hides the Hotspot's associated icon, provided that the Settings Manager's hotspotIconDisplay = HotspotIconDisplay.ViaScriptOnly
makeVisible | If True, the icon will be shown. If false, the icon will be hidden |
speed | The speed at which to show or hide the icon. If <=0, the transition will be instantaneous. |
void AC.Hotspot.SetName | ( | string | newName, |
int | _lineID | ||
) |
Renames the Hotspot mid-game.
newName | The new name of the Hotspot |
_lineID | The translation ID number assocated with the new name, as set by SpeechManager |
void AC.Hotspot.SetProximity | ( | bool | isGameplay | ) |
Highlights the Hotspot based on the mouse cursor's proximity.
isGameplay | If True, then it is during gameplay, and the highlight effect will work |
void AC.Hotspot.SetTranslationID | ( | int | index, |
int | lineID | ||
) |
Sets the translation ID of a given text index
index | The index of the translatable text |
lineID | The new translation ID to assign the translatable text |
Implements AC.ITranslatable.
void AC.Hotspot.ShowInteractionMenu | ( | Menu | menu, |
bool | includeInventoryItems | ||
) |
Turns on a specific Menu, linking any Interaction icons in it to the Hotspot. The Menu doesn't need to have an appearType of AppearType.OnInteraction.
void AC.Hotspot.ShowInteractionMenus | ( | ) |
Shows any Menus with appearType = AppearType.OnInteraction, linking any Interactino icons in it to the Hotspot
void AC.Hotspot.TurnOff | ( | ) |
Disables the Hotspot.
|
virtual |
void AC.Hotspot.TurnOn | ( | ) |
Enables the Hotspot.
|
virtual |
void AC.Hotspot.UpdateIcon | ( | ) |
Recalculates the alpha value of the Hotspot's icon.
void AC.Hotspot.UpdateProximity | ( | DetectHotspots | detectHotspots | ) |
Sets the layer of the Hotspot according to whether or not it is within the proximity of a Hotspot detector.
detectHotspot | The DetectHotspots component to check the proximity against |
bool AC.Hotspot.UpdateUnhandledVisibility | ( | ) |
bool AC.Hotspot.UpgradeSelf | ( | ) |
Upgrades the Hotspot from a previous version of Adventure Creator.
bool AC.Hotspot.canBeLowerCase = false |
Transform AC.Hotspot.centrePoint |
CentrePointOverrides AC.Hotspot.centrePointOverrides = CentrePointOverrides.FacingAndIconPosition |
What the centrePoint overrides, if set
int AC.Hotspot.displayLineID = -1 |
The translation ID number of the Hotspot's name, if it was changed mid-game
DoubleClickingHotspot AC.Hotspot.doubleClickingHotspot = DoubleClickingHotspot.MakesPlayerRun |
The effect that double-clicking on the Hotspot has, if interactionMethod = AC_InteractionMethod.ContextSensitive in SettingsManager
bool AC.Hotspot.drawGizmos = true |
If True, then a Gizmo may be drawn in the Scene window at the Hotspots's position
Highlight AC.Hotspot.highlight |
string AC.Hotspot.hotspotName |
The display name, if not the GameObject's name
string AC.Hotspot.iconSortingLayer = "" |
The 'Sorting Layer' of the icon's SpriteRenderer, if drawn in World Space
int AC.Hotspot.iconSortingOrder = 0 |
The 'Order in Layer' of the icon's SpriteRenderer, if drawn in World Space
AC.InteractionSource AC.Hotspot.interactionSource |
The source of the commands that are run when an option is chosen (InScene, AssetFile, CustomScript)
InteractiveBoundary AC.Hotspot.interactiveBoundary = null |
If assigned, then the Hotspot will only be interactive when the player is within this Trigger Collider's boundary
A List of all available 'Inventory' interactions
int AC.Hotspot.lastInteractionIndex = 0 |
The index of the last-active interaction
int AC.Hotspot.lineID = -1 |
The translation ID number of the Hotspot's name, as generated by SpeechManager
The 'Examine' interaction, if interactionMethod = AC_InteractionMethod.ContextSensitive in SettingsManager
bool AC.Hotspot.oneClick = false |
If True, then clicking the Hotspot will run the Hotspot's first interaction in useButtons, regardless of the interactionMethod chosen in SettingsManager
bool AC.Hotspot.playerTurnsHead = true |
If True, then the player will turn their head when the Hotspot is selected (if SettingsManager's playerFacesHotspots = True)
bool AC.Hotspot.provideInvInteraction |
If True, then the Hotspot can have 'Inventory' interactions
bool AC.Hotspot.provideLookInteraction |
If True, then the Hotspot can have an 'Examine' interaction, if interactionMethod = AC_InteractionMethod.ContextSensitive in SettingsManager
bool AC.Hotspot.provideUnhandledInvInteraction |
If True, then the Hotspot can have an unhandled 'Inventory' interaction
bool AC.Hotspot.provideUnhandledUseInteraction |
If True, then the Hotspot can have an unhandled 'Use' interaction
bool AC.Hotspot.provideUseInteraction |
If True, then the Hotspot can have 'Use" interactions
The unhandled 'Inventory' interaction, which will be run if the player uses an inventory item on the Hotspot, and it is not handled within invButtons
Marker AC.Hotspot.walkToMarker |
The Marker that the player can optionally automatically walk to before an Interaction runs
|
getset |
|
get |
A cache of the Hotspot's transform component