Adventure Creator  1.66.8
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2018
AC.ConstantID Class Reference
Inheritance diagram for AC.ConstantID:
AC.Remember AC.RememberTransform AC.RememberAnimator AC.RememberCollider AC.RememberContainer AC.RememberConversation AC.RememberFootstepSounds AC.RememberHotspot AC.RememberMaterial AC.RememberMoveable AC.RememberName AC.RememberNavMesh2D AC.RememberNPC AC.RememberShapeable AC.RememberSound AC.RememberTimeline AC.RememberTrigger AC.RememberVisibility

Public Member Functions

virtual string SaveData ()
 Serialises appropriate GameObject values into a string. Overriden by subclasses. More...
 
virtual void LoadData (string stringData)
 Deserialises a string of data, and restores the GameObject to its previous state. Overridden by subclasses. More...
 
virtual void LoadData (string stringData, bool restoringSaveFile)
 A base function, overridden by subclasses when loading data. More...
 
int AssignInitialValue (bool forcePrefab=false)
 Sets a new Constant ID number. More...
 
void SetNewID_Prefab ()
 

Public Attributes

int constantID
 
bool retainInPrefab = false
 
AutoManual autoManual = AutoManual.Automatic
 

Protected Member Functions

bool GameIsPlaying ()
 
void Update ()
 
bool [] StringToBoolArray (string _string)
 
int [] StringToIntArray (string _string)
 
float [] StringToFloatArray (string _string)
 
string [] StringToStringArray (string _string)
 
string ArrayToString< T > (T[] _list)
 

Detailed Description

This script is used by the Serialization classes to store a permanent ID of the gameObject (like InstanceID, only retained after reloading the project). To save a reference to an arbitrary object in a scene, this script must be attached to it.

Member Function Documentation

◆ AssignInitialValue()

int AC.ConstantID.AssignInitialValue ( bool  forcePrefab = false)

Sets a new Constant ID number.

Parameters
forcePrefabIf True, sets "retainInPrefab" to True. Otherwise, it will be determined by whether or not the component is part of an asset file.

◆ LoadData() [1/2]

virtual void AC.ConstantID.LoadData ( string  stringData)
virtual

Deserialises a string of data, and restores the GameObject to its previous state. Overridden by subclasses.

Parameters
stringDataThe data, serialised as a string

Reimplemented in AC.RememberVisibility, AC.RememberMoveable, AC.RememberNPC, AC.RememberCollider, AC.RememberTrigger, AC.RememberHotspot, AC.RememberConversation, AC.RememberNavMesh2D, AC.RememberContainer, AC.RememberShapeable, AC.RememberMaterial, AC.RememberFootstepSounds, AC.RememberAnimator, and AC.RememberName.

◆ LoadData() [2/2]

virtual void AC.ConstantID.LoadData ( string  stringData,
bool  restoringSaveFile 
)
virtual

A base function, overridden by subclasses when loading data.

Parameters
stringDataA string of serialised data
restoringSaveFileTrue if the game is currently restoring a save game file, as opposed to transitioning between scenes

Reimplemented in AC.RememberTimeline, and AC.RememberSound.

◆ SaveData()

virtual string AC.ConstantID.SaveData ( )
virtual

◆ SetNewID_Prefab()

void AC.ConstantID.SetNewID_Prefab ( )

Sets a new Constant ID number for a prefab.

Member Data Documentation

◆ autoManual

AutoManual AC.ConstantID.autoManual = AutoManual.Automatic

Is the Constant ID set automatically or manually?

◆ constantID

int AC.ConstantID.constantID

The recorded Constant ID number

◆ retainInPrefab

bool AC.ConstantID.retainInPrefab = false

If True, prefabs will share the same Constant ID as their scene-based counterparts