Adventure Creator  1.79.1
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2022
AC.PlayerData Class Reference

Public Member Functions

void UpdatePosition (int newSceneIndex, TeleportPlayerStartMethod teleportPlayerStartMethod, int playerStartID)
 Updates the record of the Player's current position More...
 
void UpdatePosition (string newSceneName, TeleportPlayerStartMethod teleportPlayerStartMethod, int playerStartID)
 Updates the record of the Player's current position More...
 
void UpdatePosition (TeleportPlayerStartMethod teleportPlayerStartMethod, PlayerStart playerStart)
 Updates the record of the Player's current position to the current scene More...
 
void CopyPosition (PlayerData playerData)
 Copies the record of the Player's current position from another PlayerData instance More...
 
void UpdateFromTempPosition (Player sceneInstance)
 Updates the record of the Player's current position, based on data made when their scene was not active More...
 
void ClearPathData ()
 
void UpdateCurrentAndShiftPrevious (int newSceneIndex)
 Updates the internal record of the player's current scene More...
 
void UpdateCurrentAndShiftPrevious (string newSceneName)
 Updates the internal record of the player's current scene More...
 
void ShowGUI ()
 

Public Attributes

int playerID = 0
 
int currentScene = -1
 
string currentSceneName = ""
 
int previousScene = -1
 
string previousSceneName = ""
 
string openSubScenes = ""
 
string openSubSceneNames = ""
 
float playerLocX = 0f
 
float playerLocY = 0f
 
float playerLocZ = 0f
 
float playerRotY = 0f
 
float playerWalkSpeed = 0f
 
float playerRunSpeed = 0f
 
string playerIdleAnim = ""
 
string playerWalkAnim = ""
 
string playerTalkAnim = ""
 
string playerRunAnim = ""
 
string playerWalkSound = ""
 
string playerRunSound = ""
 
string playerPortraitGraphic = ""
 
string playerSpeechLabel = ""
 
int playerDisplayLineID = 0
 
int playerTargetNode = 0
 
int playerPrevNode = 0
 
string playerPathData = ""
 
bool playerIsRunning = false
 
bool playerLockedPath = false
 
bool playerLockedPathReversing = false
 
int playerLockedPathType
 
int playerActivePath = 0
 
bool playerPathAffectY = false
 
int lastPlayerTargetNode = 0
 
int lastPlayerPrevNode = 0
 
int lastPlayerActivePath = 0
 
bool playerUpLock = false
 
bool playerDownLock = false
 
bool playerLeftlock = false
 
bool playerRightLock = false
 
int playerRunLock = 0
 
bool playerFreeAimLock = false
 
bool playerIgnoreGravity = false
 
bool playerLockDirection = false
 
string playerSpriteDirection = ""
 
bool playerLockScale = false
 
float playerSpriteScale = 0f
 
bool playerLockSorting = false
 
int playerSortingOrder = 0
 
string playerSortingLayer = ""
 
string inventoryData = ""
 
bool inCustomCharState = false
 
bool playerLockHotspotHeadTurning = false
 
bool isHeadTurning = false
 
int headTargetID = 0
 
float headTargetX = 0f
 
float headTargetY = 0f
 
float headTargetZ = 0f
 
int gameCamera = 0
 
int lastNavCamera = 0
 
int lastNavCamera2 = 0
 
float mainCameraLocX = 0f
 
float mainCameraLocY = 0f
 
float mainCameraLocZ = 0f
 
float mainCameraRotX = 0f
 
float mainCameraRotY = 0f
 
float mainCameraRotZ = 0f
 
bool isSplitScreen = false
 
bool isTopLeftSplit = false
 
bool splitIsVertical = false
 
int splitCameraID = 0
 
float splitAmountMain = 0f
 
float splitAmountOther = 0f
 
float shakeIntensity = 0f
 
float shakeDuration = 0f
 
int shakeEffect = 0
 
float overlayRectX
 
bool followSortingMap = false
 
int customSortingMapID = 0
 
int activeDocumentID = -1
 
string collectedDocumentData = ""
 
string lastOpenDocumentPagesData = ""
 
string playerObjectivesData = ""
 
int followTargetID = 0
 
bool followTargetIsPlayer = false
 
float followFrequency = 0f
 
float followDistance = 0f
 
float followDistanceMax = 0f
 
bool followFaceWhenIdle = false
 
bool followRandomDirection = false
 
bool followAcrossScenes = false
 
string leftHandIKState
 
string rightHandIKState
 
string spriteDirectionData
 
List< ScriptDataplayerScriptData = new List<ScriptData>()
 
int tempPlayerStart = 0
 
TeleportPlayerStartMethod tempTeleportPlayerStartMethod
 

Properties

Vector3 PlayerPosition [get]
 
Quaternion PlayerRotation [get]
 

Detailed Description

A data container for saving the state of a Player. Each Player in a game has its own instance of this class stored in SaveData by SaveSystem.

Member Function Documentation

◆ ClearPathData()

void AC.PlayerData.ClearPathData ( )

Clears all data related to current pathfinding and movement

◆ CopyPosition()

void AC.PlayerData.CopyPosition ( PlayerData  playerData)

Copies the record of the Player's current position from another PlayerData instance

Parameters
playerDataThe PlayerData class instance to copy from

◆ UpdateCurrentAndShiftPrevious() [1/2]

void AC.PlayerData.UpdateCurrentAndShiftPrevious ( int  newSceneIndex)

Updates the internal record of the player's current scene

Parameters
newSceneIndexThe index of the new scene

◆ UpdateCurrentAndShiftPrevious() [2/2]

void AC.PlayerData.UpdateCurrentAndShiftPrevious ( string  newSceneName)

Updates the internal record of the player's current scene

Parameters
newSceneIndexThe index of the new scene

◆ UpdateFromTempPosition()

void AC.PlayerData.UpdateFromTempPosition ( Player  sceneInstance)

Updates the record of the Player's current position, based on data made when their scene was not active

Parameters
sceneInstanceThe scene instance of the Player to affect

◆ UpdatePosition() [1/3]

void AC.PlayerData.UpdatePosition ( int  newSceneIndex,
TeleportPlayerStartMethod  teleportPlayerStartMethod,
int  playerStartID 
)

Updates the record of the Player's current position

Parameters
newSceneIndexThe scene in which to place the Player in
teleportPlayerStartMethodHow to select which PlayerStart to appear at (SceneDefault, BasedOnPrevious, EnteredHere)
playerStartIDThe Constant ID value of the PlayerStart for the Player to appear at

◆ UpdatePosition() [2/3]

void AC.PlayerData.UpdatePosition ( string  newSceneName,
TeleportPlayerStartMethod  teleportPlayerStartMethod,
int  playerStartID 
)

Updates the record of the Player's current position

Parameters
newSceneNameThe scene in which to place the Player in
teleportPlayerStartMethodHow to select which PlayerStart to appear at (SceneDefault, BasedOnPrevious, EnteredHere)
playerStartIDThe Constant ID value of the PlayerStart for the Player to appear at

◆ UpdatePosition() [3/3]

void AC.PlayerData.UpdatePosition ( TeleportPlayerStartMethod  teleportPlayerStartMethod,
PlayerStart  playerStart 
)

Updates the record of the Player's current position to the current scene

Parameters
teleportPlayerStartMethodHow to select which PlayerStart to appear at (SceneDefault, BasedOnPrevious, EnteredHere)
playerStartThe PlayerStart for the Player to appear at

Member Data Documentation

◆ activeDocumentID

int AC.PlayerData.activeDocumentID = -1

The active Document being read

◆ collectedDocumentData

string AC.PlayerData.collectedDocumentData = ""

A record of the Documents collected

◆ currentScene

int AC.PlayerData.currentScene = -1

The current scene number

◆ currentSceneName

string AC.PlayerData.currentSceneName = ""

The current scene name

◆ customSortingMapID

int AC.PlayerData.customSortingMapID = 0

The ConstantID number of the SortingMap that the NPC's FollowSortingMap follows, if not the scene's default

◆ followAcrossScenes

bool AC.PlayerData.followAcrossScenes = false

If True, and the character is an inactive Player, they can follow the active Player across scenes

◆ followDistance

float AC.PlayerData.followDistance = 0f

The distance that the non-active-Players keeps with when following its target

◆ followDistanceMax

float AC.PlayerData.followDistanceMax = 0f

The maximum distance that the non-active-Players keeps when following its target

◆ followFaceWhenIdle

bool AC.PlayerData.followFaceWhenIdle = false

If True, the non-active-Players will face their follow target when idle

◆ followFrequency

float AC.PlayerData.followFrequency = 0f

The frequency with which the non-active-Players follows its target

◆ followRandomDirection

bool AC.PlayerData.followRandomDirection = false

If True, the non-active-Players will stand a random direction from their target

◆ followSortingMap

bool AC.PlayerData.followSortingMap = false

True if the NPC has a FollowSortingMap component that follows the scene's default SortingMap

◆ followTargetID

int AC.PlayerData.followTargetID = 0

The Constant ID number of the non-active-Players's follow target

◆ followTargetIsPlayer

bool AC.PlayerData.followTargetIsPlayer = false

True if the non-active-Players is following the player

◆ gameCamera

int AC.PlayerData.gameCamera = 0

The Constant ID number of the active _Camera

◆ headTargetID

int AC.PlayerData.headTargetID = 0

The ConstantID number of the head target Transform

◆ headTargetX

float AC.PlayerData.headTargetX = 0f

The Player's head target's X position (offset)

◆ headTargetY

float AC.PlayerData.headTargetY = 0f

The Player's head target's Y position (offset)

◆ headTargetZ

float AC.PlayerData.headTargetZ = 0f

The Player's head target's Z position (offset)

◆ inCustomCharState

bool AC.PlayerData.inCustomCharState = false

If True, the Player is playing a custom animation

◆ inventoryData

string AC.PlayerData.inventoryData = ""

What Inventory Items (see: InvItem) the player is currently carrying

◆ isHeadTurning

bool AC.PlayerData.isHeadTurning = false

True if the Player's head is facing a particular object

◆ isSplitScreen

bool AC.PlayerData.isSplitScreen = false

True if split-screen is currently active

◆ isTopLeftSplit

bool AC.PlayerData.isTopLeftSplit = false

True if the gameplay is performed in the top (or left) side during split-screen

◆ lastNavCamera

int AC.PlayerData.lastNavCamera = 0

The Constant ID number of the last active _Camera during gameplay

◆ lastNavCamera2

int AC.PlayerData.lastNavCamera2 = 0

The Constant ID number of the last active-but-one _Camera during gameplay

◆ lastOpenDocumentPagesData

string AC.PlayerData.lastOpenDocumentPagesData = ""

Deprecated

◆ lastPlayerActivePath

int AC.PlayerData.lastPlayerActivePath = 0

The Constant ID number of the Player's last-used Path

◆ lastPlayerPrevNode

int AC.PlayerData.lastPlayerPrevNode = 0

The previous node number of the Player's last-used Path

◆ lastPlayerTargetNode

int AC.PlayerData.lastPlayerTargetNode = 0

The target node number of the Player's last-used Path

◆ leftHandIKState

string AC.PlayerData.leftHandIKState

Data related to the character's left hand Ik state

◆ mainCameraLocX

float AC.PlayerData.mainCameraLocX = 0f

The MainCamera's X position

◆ mainCameraLocY

float AC.PlayerData.mainCameraLocY = 0f

The MainCamera's Y position

◆ mainCameraLocZ

float AC.PlayerData.mainCameraLocZ = 0f

The MainCamera's Z position

◆ mainCameraRotX

float AC.PlayerData.mainCameraRotX = 0f

The MainCamera's X rotation

◆ mainCameraRotY

float AC.PlayerData.mainCameraRotY = 0f

The MainCamera's Y rotation

◆ mainCameraRotZ

float AC.PlayerData.mainCameraRotZ = 0f

The MainCamera's Z rotation

◆ openSubSceneNames

string AC.PlayerData.openSubSceneNames = ""

The details any sub-scenes that are also open (as names)

◆ openSubScenes

string AC.PlayerData.openSubScenes = ""

The details any sub-scenes that are also open (as build indices)

◆ overlayRectX

float AC.PlayerData.overlayRectX

During box-overlay, the size and position of the overlay effect

◆ playerActivePath

int AC.PlayerData.playerActivePath = 0

The Constant ID number of the Player's current Path

◆ playerDisplayLineID

int AC.PlayerData.playerDisplayLineID = 0

The ID number that references the Player's name, as generated by the Speech Manager

◆ playerDownLock

bool AC.PlayerData.playerDownLock = false

True if the Player cannot move down

◆ playerFreeAimLock

bool AC.PlayerData.playerFreeAimLock = false

True if free-aiming is prevented

◆ playerID

int AC.PlayerData.playerID = 0

The ID number of the Player that this data references

◆ playerIdleAnim

string AC.PlayerData.playerIdleAnim = ""

The idle animation

◆ playerIgnoreGravity

bool AC.PlayerData.playerIgnoreGravity = false

True if the Player's Rigidbody is unaffected by gravity

◆ playerIsRunning

bool AC.PlayerData.playerIsRunning = false

True if the Player is currently running

◆ playerLeftlock

bool AC.PlayerData.playerLeftlock = false

True if the Player cannot move left

◆ playerLockDirection

bool AC.PlayerData.playerLockDirection = false

True if a sprite-based Player is locked to face a particular direction

◆ playerLockedPath

bool AC.PlayerData.playerLockedPath = false

True if the Player is locked along a Path

◆ playerLockedPathReversing

bool AC.PlayerData.playerLockedPathReversing = false

True if the Player is locked along a Path, and going backwards

◆ playerLockedPathType

int AC.PlayerData.playerLockedPathType

The type of Path the Player is locked along, if playerLockedPathReversing = true

◆ playerLockHotspotHeadTurning

bool AC.PlayerData.playerLockHotspotHeadTurning = false

True if the Player's head is facing a Hotspot

◆ playerLockScale

bool AC.PlayerData.playerLockScale = false

True if a sprite-based Player has its scale locked

◆ playerLockSorting

bool AC.PlayerData.playerLockSorting = false

True if a sprite-based Player has its sorting locked

◆ playerLocX

float AC.PlayerData.playerLocX = 0f

The Player's X position

◆ playerLocY

float AC.PlayerData.playerLocY = 0f

The Player's Y position

◆ playerLocZ

float AC.PlayerData.playerLocZ = 0f

The Player's Z position

◆ playerObjectivesData

string AC.PlayerData.playerObjectivesData = ""

A record of the player's current objectives

◆ playerPathAffectY

bool AC.PlayerData.playerPathAffectY = false

True if the Player's current Path affects the Y position

◆ playerPathData

string AC.PlayerData.playerPathData = ""

The positions of each node in a pathfinding-generated Path

◆ playerPortraitGraphic

string AC.PlayerData.playerPortraitGraphic = ""

A unique identified for the portrait graphic

◆ playerPrevNode

int AC.PlayerData.playerPrevNode = 0

The previous node number of the current Path

◆ playerRightLock

bool AC.PlayerData.playerRightLock = false

True if the Player cannot move right

◆ playerRotY

float AC.PlayerData.playerRotY = 0f

The Player'sY rotation

◆ playerRunAnim

string AC.PlayerData.playerRunAnim = ""

The run animation

◆ playerRunLock

int AC.PlayerData.playerRunLock = 0

True if the Player cannot run

◆ playerRunSound

string AC.PlayerData.playerRunSound = ""

A unique identifier for the run sound AudioClip

◆ playerRunSpeed

float AC.PlayerData.playerRunSpeed = 0f

The run speed

◆ playerScriptData

List<ScriptData> AC.PlayerData.playerScriptData = new List<ScriptData>()

Save data for any Remember components attached to the Player

◆ playerSortingLayer

string AC.PlayerData.playerSortingLayer = ""

The order in layer of a sprite-based Player

◆ playerSortingOrder

int AC.PlayerData.playerSortingOrder = 0

The sorting order of a sprite-based Player

◆ playerSpeechLabel

string AC.PlayerData.playerSpeechLabel = ""

The Player's display name

◆ playerSpriteDirection

string AC.PlayerData.playerSpriteDirection = ""

The direction that a sprite-based Player is currently facing

◆ playerSpriteScale

float AC.PlayerData.playerSpriteScale = 0f

The scale of a sprite-based Player

◆ playerTalkAnim

string AC.PlayerData.playerTalkAnim = ""

The talk animation

◆ playerTargetNode

int AC.PlayerData.playerTargetNode = 0

The target node number of the current Path

◆ playerUpLock

bool AC.PlayerData.playerUpLock = false

True if the Player cannot move up

◆ playerWalkAnim

string AC.PlayerData.playerWalkAnim = ""

The walk animation

◆ playerWalkSound

string AC.PlayerData.playerWalkSound = ""

A unique identifier for the walk sound AudioClip

◆ playerWalkSpeed

float AC.PlayerData.playerWalkSpeed = 0f

The walk speed

◆ previousScene

int AC.PlayerData.previousScene = -1

The last-visited scene number

◆ previousSceneName

string AC.PlayerData.previousSceneName = ""

The last-visited scene name

◆ rightHandIKState

string AC.PlayerData.rightHandIKState

Data related to the character's right hand Ik state

◆ shakeDuration

float AC.PlayerData.shakeDuration = 0f

The duration, in seconds, of the current camera shake

◆ shakeEffect

int AC.PlayerData.shakeEffect = 0

The int-converted value of CamersShakeEffect

◆ shakeIntensity

float AC.PlayerData.shakeIntensity = 0f

The intensity of the current camera shake

◆ splitAmountMain

float AC.PlayerData.splitAmountMain = 0f

During split-screen, the proportion of the screen that the gameplay camera takes up

◆ splitAmountOther

float AC.PlayerData.splitAmountOther = 0f

During split-screen, the proportion of the screen that the non-gameplay camera take up

◆ splitCameraID

int AC.PlayerData.splitCameraID = 0

The Constant ID number of the split-screen camera that gameplay is not performed in

◆ splitIsVertical

bool AC.PlayerData.splitIsVertical = false

True if split-screen is arranged vertically

◆ spriteDirectionData

string AC.PlayerData.spriteDirectionData

Data related to the character's available sprite directions

◆ tempPlayerStart

int AC.PlayerData.tempPlayerStart = 0

The Constant ID number of the PlayerStart to appear at when that PlayerStart's scene is next opened

Property Documentation

◆ PlayerPosition

Vector3 AC.PlayerData.PlayerPosition
get

The Player's position data

◆ PlayerRotation

Quaternion AC.PlayerData.PlayerRotation
get

The Player's rotation data