Class GameplayGlobals
The global gameplay variables container asset that can be accessed across whole project.
Namespace: FlaxEngine
Assembly: FlaxEngine.CSharp.dll
Syntax
[Unmanaged]
public class GameplayGlobals : BinaryAsset
Constructors
GameplayGlobals()
Properties
DefaultValues
Gets or sets the default values (edit-time).
Declaration
[Unmanaged]
public Dictionary<string, object> DefaultValues { get; set; }
Property Value
System.Collections.Generic.Dictionary<System.String, System.Object>
|
Values
Gets or sets the values (run-time).
Declaration
[Unmanaged]
public Dictionary<string, object> Values { get; set; }
Property Value
System.Collections.Generic.Dictionary<System.String, System.Object>
|
Methods
GetValue(String)
Gets the value of the global variable (it must be added first).
Declaration
[Unmanaged]
public object GetValue(string name)
Parameters
System.String
name
The variable name. |
Returns
System.Object
The value. |
ResetValues()
Resets the variables values to default values.
Declaration
[Unmanaged]
public void ResetValues()
Save(String)
Saves this asset to the file. Supported only in Editor.
Declaration
[Unmanaged]
public bool Save(string path = null)
Parameters
System.String
path
The custom asset path to use for the saving. Use empty value to save this asset to its own storage location. Can be used to duplicate asset. Must be specified when saving virtual asset. |
Returns
System.Boolean
True if cannot save data, otherwise false. |
SetValue(String, Object)
Sets the value of the global variable (it must be added first).
Declaration
[Unmanaged]
public void SetValue(string name, object value)
Parameters
System.String
name
The variable name. |
System.Object
value
The value. |