All Classes Namespaces Functions Variables Enumerations Enumerator Properties
plyBloxKit.plyBloxGlobal Class Reference

THe plyBlox System's Global object, containing Global Variables and Blox system settings. More...

Inherits MonoBehaviour, and plyCommon.plyDataProviderInterface.

Public Member Functions

bool VariableDefined (string name)
 Returns True if variable defined, else False More...
 
plyVar GetVariable (string name)
 Returns a reference to the Global Variable. Will return null if the variable does not exist. More...
 
object GetVarValue (string name)
 Returns the Global Variable's value. The Type of the returned value depends on what kind of variable it is. See plyVar for more information. Returns null if the named variable does not exist. Keep in mind that the value might simply be null. More...
 
plyVar SetVarValue (string name, object val)
 Set the value of a Global Variable. The variable will adopt the new value type. Will create the named variable if it does not exist. Returns reference to variable. Returns null if failed to create the variable. More...
 
plyVar SetVarValue (string name, object val, bool persist)
 Set the value of a Global Variable. The variable will adopt the new value type. Will create the named variable if it does not exist. Returns reference to variable. Returns null if failed to create the variable. persist will only be applied if it is a new variable. More...
 
string EncodeVariables (bool includeNotPersistVariables)
 Encode the global variables and data into a string. This can be saved to later send to DecodeVariables. (char)30 and (char)31 are used as separators. GameObject, SystemObject and UnityObject will not be encoded. More...
 
void DecodeVariables (string data_s)
 Decode a string that was previously encoded by EncodeVariables More...
 
object DataProvider_GetValue (string[] nfo)
 
void DataProvider_SetValue (string[] nfo, object value)
 
void DataProvider_Callback (string[] nfo)
 

Static Public Member Functions

static plyBloxGlobal GetInstance (GameObject prefab)
 Get a reference to the plyBlox Global Instance. Create it from the provided prefab if it does not exist yet. More...
 

Public Attributes

List< plyVarvars = new List<plyVar>(0)
 List of defined global variables. Do not access this directly, use the provided functions.
 

Protected Member Functions

void Awake ()
 

Properties

static plyBloxGlobal Instance [get, set]
 Gets an Instance of the pyBlox Global. There should only be one instance of it at runtime. More...
 
Dictionary< string, plyVarRuntimeVars [get]
 
static bool InstanceExist [get]
 Will return true if an instance of the plyBloxGlobal exist. More...
 

Detailed Description

THe plyBlox System's Global object, containing Global Variables and Blox system settings.

Member Function Documentation

void plyBloxKit.plyBloxGlobal.DecodeVariables ( string  data_s)

Decode a string that was previously encoded by EncodeVariables

string plyBloxKit.plyBloxGlobal.EncodeVariables ( bool  includeNotPersistVariables)

Encode the global variables and data into a string. This can be saved to later send to DecodeVariables. (char)30 and (char)31 are used as separators. GameObject, SystemObject and UnityObject will not be encoded.

static plyBloxGlobal plyBloxKit.plyBloxGlobal.GetInstance ( GameObject  prefab)
static

Get a reference to the plyBlox Global Instance. Create it from the provided prefab if it does not exist yet.

plyVar plyBloxKit.plyBloxGlobal.GetVariable ( string  name)

Returns a reference to the Global Variable. Will return null if the variable does not exist.

object plyBloxKit.plyBloxGlobal.GetVarValue ( string  name)

Returns the Global Variable's value. The Type of the returned value depends on what kind of variable it is. See plyVar for more information. Returns null if the named variable does not exist. Keep in mind that the value might simply be null.

plyVar plyBloxKit.plyBloxGlobal.SetVarValue ( string  name,
object  val 
)

Set the value of a Global Variable. The variable will adopt the new value type. Will create the named variable if it does not exist. Returns reference to variable. Returns null if failed to create the variable.

plyVar plyBloxKit.plyBloxGlobal.SetVarValue ( string  name,
object  val,
bool  persist 
)

Set the value of a Global Variable. The variable will adopt the new value type. Will create the named variable if it does not exist. Returns reference to variable. Returns null if failed to create the variable. persist will only be applied if it is a new variable.

bool plyBloxKit.plyBloxGlobal.VariableDefined ( string  name)

Returns True if variable defined, else False

Property Documentation

plyBloxGlobal plyBloxKit.plyBloxGlobal.Instance
staticgetset

Gets an Instance of the pyBlox Global. There should only be one instance of it at runtime.

bool plyBloxKit.plyBloxGlobal.InstanceExist
staticget

Will return true if an instance of the plyBloxGlobal exist.