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

Public Member Functions

 PlayerPrefab (Player _playerOb)
 
 PlayerPrefab (int[] idArray)
 
Player GetSceneInstance ()
 Gets the runtime scene instance of the Player More...
 
PlayerData GetPlayerData ()
 
void SetInitialPosition (PlayerData playerData)
 
void RemoveFromScene ()
 
bool IsValid (bool warnIfNot=true)
 
Player EditModeLoadAddressable ()
 
void ShowGUI (string apiPrefix)
 
void ShowStartDataGUI (string apiPrefix)
 

Static Public Member Functions

static void FindPlayerReferences (int playerID, string playerName)
 

Public Attributes

Player playerOb
 
int ID
 
bool isDefault
 
int startingSceneIndex = 0
 
ChooseSceneBy chooseSceneBy = ChooseSceneBy.Number
 
string startingSceneName = ""
 
bool useSceneDefaultPlayerStart = true
 
int startingPlayerStartID
 

Properties

Player EditorPrefab [get]
 

Detailed Description

A data container for a Player that is spawned automatically at runtime, and whose data is tracked automatically.

Constructor & Destructor Documentation

◆ PlayerPrefab()

AC.PlayerPrefab.PlayerPrefab ( int[]  idArray)

The default Constructor. An array of ID numbers is required, to ensure its own ID is unique.

Member Function Documentation

◆ GetSceneInstance()

Player AC.PlayerPrefab.GetSceneInstance ( )

Gets the runtime scene instance of the Player

Parameters
spawnIfNotPresentIf True, the Player will be spawned if no scene instance was found.
Returns
The scene instance of the Player

◆ RemoveFromScene()

void AC.PlayerPrefab.RemoveFromScene ( )

Removes any runtime instance of the Player from the scene

Member Data Documentation

◆ chooseSceneBy

ChooseSceneBy AC.PlayerPrefab.chooseSceneBy = ChooseSceneBy.Number

How to reference the Player's starting scene, if not the default (Name, Number)

◆ ID

int AC.PlayerPrefab.ID

A unique identifier

◆ isDefault

bool AC.PlayerPrefab.isDefault

If True, this Player is the game's default

◆ playerOb

Player AC.PlayerPrefab.playerOb

The Player prefab

◆ startingPlayerStartID

int AC.PlayerPrefab.startingPlayerStartID

The ConstantID value of the PlayerStart to appear at, if not the default Player

◆ startingSceneIndex

int AC.PlayerPrefab.startingSceneIndex = 0

The scene index to start in, if the Player is not the default, and chooseSceneBy = ChooseSceneBy.Number

◆ startingSceneName

string AC.PlayerPrefab.startingSceneName = ""

The name of the scene to start in, if the Player is not the default, and chooseSceneBy = ChooseSceneBy.Name

◆ useSceneDefaultPlayerStart

bool AC.PlayerPrefab.useSceneDefaultPlayerStart = true

If True, then the Player will appear at their initial scene's Default PlayerStart - as opposed to one specified here