Class GameplayGlobals
The global gameplay variables container asset that can be accessed across whole project.
Inherited Members
Assembly: FlaxEngine.dll
File: Engine/Engine/GameplayGlobals.h
Syntax
public class GameplayGlobals : public BinaryAsset
Fields
Variables
The collection of gameplay global variables identified by the name.
Declaration
public Dictionary<String, Variable> Variables
Field Value
Dictionary<String, Variable>
|
Methods
getChunksToPreload()
Gets packed chunks indices to preload before asset loading action
Declaration
protected virtual AssetChunksFlag getChunksToPreload() const override
Returns
AssetChunksFlag
Chunks to load flags |
Overrides
GetDefaultValues()
Gets the default values (edit-time).
Declaration
public Dictionary<String, Variant> GetDefaultValues() const
Returns
Dictionary<String, Variant>
The default values (edit-time). |
GetValue(const StringView& name)
Gets the value of the global variable (it must be added first).
Declaration
public Variant GetValue(const StringView& name) const
Parameters
StringView
name
The variable name. |
Returns
Variant
The value. |
GetValues()
Gets the values (run-time).
Declaration
public Dictionary<String, Variant> GetValues() const
Returns
Dictionary<String, Variant>
The values (run-time). |
InitAsVirtual()
Initializes asset data as virtual asset.
Declaration
public virtual void InitAsVirtual() override
Overrides
load()
Load data from the chunks
Declaration
protected virtual LoadResult load() override
Returns
LoadResult
Loading result |
Overrides
ResetValues()
Resets the variables values to default values.
Declaration
public void ResetValues()
Save(const StringView& path=StringView::Empty)
Saves this asset to the file. Supported only in Editor.
Declaration
public virtual bool Save(const StringView& path=StringView::Empty) override
Parameters
StringView
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
bool
True when cannot save data, otherwise false. |
Overrides
SetDefaultValues(const Dictionary<String, Variant>& values)
Sets the default values (edit-time).
Declaration
public void SetDefaultValues(const Dictionary<String, Variant>& values)
Parameters
Dictionary<String, Variant>
values
The default values (edit-time). |
SetValue(const StringView& name, const Variant& value)
Sets the value of the global variable (it must be added first).
Declaration
public void SetValue(const StringView& name, const Variant& value)
Parameters
StringView
name
The variable name. |
Variant
value
The value. |
SetValues(const Dictionary<String, Variant>& values)
Sets the values (run-time).
Declaration
public void SetValues(const Dictionary<String, Variant>& values)
Parameters
Dictionary<String, Variant>
values
The values (run-time). |
unload(bool isReloading)
Unloads asset data
Declaration
protected virtual void unload(bool isReloading) override
Parameters
bool
isReloading
True if asset is reloading data, otherwise false. |