A class that can hold a value from a variety of types More...
Public Types | |
enum | DataType { DataType.Bool, DataType.Int, DataType.Float, DataType.String, DataType.Rect, DataType.Color, DataType.Vector2, DataType.Vector3, DataType.GameObject, DataType.UnityObject } |
Public Member Functions | |
plyMetaData | Copy () |
object | GetValue () |
Returns the value of this meta data. More... | |
void | ResetToType (DataType t) |
Set the meta data to default value type More... | |
void | SetValue (object val) |
Set the meta data value. More... | |
override string | ToString () |
Returns the string represents of the meta data's value. More... | |
bool | TryGetBool (out bool v) |
Attempts to get a bool value from the meta data. Return false and a default value if failed. More... | |
bool | TryGetInt (out int v) |
Attempts to get an int value from the meta data. Return false and a default value if failed. More... | |
bool | TryGetFloat (out float v) |
Attempts to get float value from the meta data. Return false and a default value if failed. More... | |
bool | TryGetRect (out Rect v) |
Attempts to get value from the meta data. Return false and a default value if failed. More... | |
bool | TryGetColor (out Color v) |
Attempts to get value from the meta data. Return false and a default value if failed. More... | |
bool | TryGetVector2 (out Vector2 v) |
Attempts to get value from the meta data. Return false and a default value if failed. More... | |
bool | TryGetVector3 (out Vector3 v) |
Attempts to get value from the meta data. Return false and a default value if failed. More... | |
bool | TryGetGameObject (out GameObject v) |
Attempts to get value from the meta data. Return false and a default value if failed. More... | |
bool | TryGetComponent (out Component v) |
Attempts to get value from the meta data. Return false and a default value if failed. More... | |
bool | TryGetUnityObject (out Object v) |
Attempts to get value from the meta data. Return false and a default value if failed. More... | |
Static Public Member Functions | |
static string | Encode (plyMetaData md) |
Return a string that can be saved and later be sued with Decode. Uses (char)31 as separator internally. Can't encode GameObject or UnityObject and will return null in these cases. More... | |
static plyMetaData | Decode (string data) |
Decodes a string to create and init the data. More... | |
Public Attributes | |
DataType | dataType = DataType.Bool |
string | name = "" |
bool | boolValue |
int | intValue |
float | floatValue |
string | stringValue |
Rect | rectValue |
Color | colorValue |
Vector2 | vect2Value |
Vector3 | vect3Value |
GameObject | goValue |
UnityEngine.Object | uObjValue |
A class that can hold a value from a variety of types
|
static |
Decodes a string to create and init the data.
|
static |
Return a string that can be saved and later be sued with Decode. Uses (char)31 as separator internally. Can't encode GameObject or UnityObject and will return null in these cases.
object plyCommon.plyMetaData.GetValue | ( | ) |
Returns the value of this meta data.
void plyCommon.plyMetaData.ResetToType | ( | DataType | t | ) |
Set the meta data to default value type
void plyCommon.plyMetaData.SetValue | ( | object | val | ) |
Set the meta data value.
override string plyCommon.plyMetaData.ToString | ( | ) |
Returns the string represents of the meta data's value.
bool plyCommon.plyMetaData.TryGetBool | ( | out bool | v | ) |
Attempts to get a bool value from the meta data. Return false and a default value if failed.
bool plyCommon.plyMetaData.TryGetColor | ( | out Color | v | ) |
Attempts to get value from the meta data. Return false and a default value if failed.
bool plyCommon.plyMetaData.TryGetComponent | ( | out Component | v | ) |
Attempts to get value from the meta data. Return false and a default value if failed.
bool plyCommon.plyMetaData.TryGetFloat | ( | out float | v | ) |
Attempts to get float value from the meta data. Return false and a default value if failed.
bool plyCommon.plyMetaData.TryGetGameObject | ( | out GameObject | v | ) |
Attempts to get value from the meta data. Return false and a default value if failed.
bool plyCommon.plyMetaData.TryGetInt | ( | out int | v | ) |
Attempts to get an int value from the meta data. Return false and a default value if failed.
bool plyCommon.plyMetaData.TryGetRect | ( | out Rect | v | ) |
Attempts to get value from the meta data. Return false and a default value if failed.
bool plyCommon.plyMetaData.TryGetUnityObject | ( | out Object | v | ) |
Attempts to get value from the meta data. Return false and a default value if failed.
bool plyCommon.plyMetaData.TryGetVector2 | ( | out Vector2 | v | ) |
Attempts to get value from the meta data. Return false and a default value if failed.
bool plyCommon.plyMetaData.TryGetVector3 | ( | out Vector3 | v | ) |
Attempts to get value from the meta data. Return false and a default value if failed.