A ConfigNode represents a collection of data that can be serialized to or deserialized from a file. A ConfigNode contains a set of values, and optionally one or more ConfigNodes, so they can be used recursively.
More...
|
static ConfigNode | CreateConfigFromObject (object obj) |
| Create a ConfigNode from a given object. This function will use reflection to scan the given object looking for fields with the [Persistent] attribute. When it finds such a field it adds it as a name-value pair to the returned ConfigNode. The name wil be the name of the field, and the value will the the serialized version of the field's data. More...
|
|
static ConfigNode | CreateConfigFromObject (object obj, int pass) |
| Like CreateConfigFromObject, but only pays attention to fields with the "pass" field of the [Persistent] attribute set to pass. More...
|
|
static object | CreateObjectFromConfig (ConfigNode node) |
|
static T | CreateObjectFromConfig< T > (ConfigNode node) |
|
static object | CreateObjectFromConfig (string typeName, ConfigNode node) |
|
static ConfigNode | Load (string fileFullName) |
|
static bool | LoadObjectFromConfig (object obj, ConfigNode node) |
| Initialize an existing object using data from the ConfigNode. This method will scan the object looking for fields with the [Persistent] attribute. When it finds such a field, it looks in the ConfigNode for a matching name-value pair, and then parses the value and sets the field to the result. More...
|
|
static bool | LoadObjectFromConfig (object obj, ConfigNode node, int pass) |
| Like LoadObjectFromConfig, but only pays attention to fields for which the "pass" field of the [Persistent] attribute is equal to pass. More...
|
|
static Color | ParseColor (string vectorString) |
|
static Color32 | ParseColor32 (string vectorString) |
|
static Enum | ParseEnum (Type enumType, string vectorString) |
|
static Matrix4x4 | ParseMatrix4x4 (string quaternionString) |
|
static Quaternion | ParseQuaternion (string quaternionString) |
|
static QuaternionD | ParseQuaternionD (string quaternionString) |
|
static Vector3 | ParseVector2 (string vectorString) |
|
static Vector3 | ParseVector3 (string vectorString) |
|
static Vector3d | ParseVector3D (string vectorString) |
|
static Vector4 | ParseVector4 (string vectorString) |
|
static string | WriteColor (Color color) |
|
static string | WriteColor (Color32 color) |
|
static string | WriteEnum (Enum en) |
|
static string | WriteMatrix4x4 (Matrix4x4 matrix) |
|
static string | WriteQuaternion (Quaternion quaternion) |
|
static string | WriteQuaternion (QuaternionD quaternion) |
|
static string | WriteVector (Vector2 vector) |
|
static string | WriteVector (Vector3 vector) |
|
static string | WriteVector (Vector3d vector) |
|
static string | WriteVector (Vector4 vector) |
|
A ConfigNode represents a collection of data that can be serialized to or deserialized from a file. A ConfigNode contains a set of values, and optionally one or more ConfigNodes, so they can be used recursively.
ConfigNode.ConfigNode |
( |
| ) |
|
ConfigNode.ConfigNode |
( |
string |
name | ) |
|
Add a sub-ConfigNode with a given name to this node.
- Parameters
-
name | The name of the new node |
- Returns
- The newly created sub-ConfigNode
void ConfigNode.AddValue |
( |
string |
name, |
|
|
object |
value |
|
) |
| |
Add a new piece of data to this ConfigNode. Values show up in serialized ConfigNodes as lines of the form
name = value
- Parameters
-
name | The name of the new value. |
value | The data to store. |
void ConfigNode.AddValue |
( |
string |
name, |
|
|
string |
value |
|
) |
| |
Add a new piece of data to this ConfigNode. Values show up in serialized ConfigNodes as lines of the form
name = value
- Parameters
-
name | The name of the new value. |
value | The data to store. |
void ConfigNode.ClearData |
( |
| ) |
|
Remove all nodes and values?
void ConfigNode.ClearNodes |
( |
| ) |
|
void ConfigNode.ClearValues |
( |
| ) |
|
Copies the contents of this node into a different ConfigNode
- Parameters
-
static ConfigNode ConfigNode.CreateConfigFromObject |
( |
object |
obj | ) |
|
|
static |
Create a ConfigNode from a given object. This function will use reflection to scan the given object looking for fields with the [Persistent] attribute. When it finds such a field it adds it as a name-value pair to the returned ConfigNode. The name wil be the name of the field, and the value will the the serialized version of the field's data.
- Parameters
-
- Returns
- A ConfigNode containing the persistent fields of the object.
static ConfigNode ConfigNode.CreateConfigFromObject |
( |
object |
obj, |
|
|
int |
pass |
|
) |
| |
|
static |
Like CreateConfigFromObject, but only pays attention to fields with the "pass" field of the [Persistent] attribute set to pass.
- Parameters
-
obj | The object to scan to create a ConfigNode. |
pass | A flag indicate which fields to serialize. |
- Returns
- A ConfigNode containing the desired persistent fields of the object.
static object ConfigNode.CreateObjectFromConfig |
( |
ConfigNode |
node | ) |
|
|
static |
static object ConfigNode.CreateObjectFromConfig |
( |
string |
typeName, |
|
|
ConfigNode |
node |
|
) |
| |
|
static |
string ConfigNode.GetValue |
( |
string |
name | ) |
|
string [] ConfigNode.GetValues |
( |
string |
name | ) |
|
bool ConfigNode.HasNode |
( |
| ) |
|
bool ConfigNode.HasNode |
( |
string |
name | ) |
|
bool ConfigNode.HasValue |
( |
| ) |
|
bool ConfigNode.HasValue |
( |
string |
name | ) |
|
static ConfigNode ConfigNode.Load |
( |
string |
fileFullName | ) |
|
|
static |
static bool ConfigNode.LoadObjectFromConfig |
( |
object |
obj, |
|
|
ConfigNode |
node |
|
) |
| |
|
static |
Initialize an existing object using data from the ConfigNode. This method will scan the object looking for fields with the [Persistent] attribute. When it finds such a field, it looks in the ConfigNode for a matching name-value pair, and then parses the value and sets the field to the result.
- Parameters
-
obj | The object to initialize |
node | The ConfigNode used to initialize the object. |
- Returns
static bool ConfigNode.LoadObjectFromConfig |
( |
object |
obj, |
|
|
ConfigNode |
node, |
|
|
int |
pass |
|
) |
| |
|
static |
Like LoadObjectFromConfig, but only pays attention to fields for which the "pass" field of the [Persistent] attribute is equal to pass.
- Parameters
-
obj | The object to initialize |
node | The ConfigNode used to initialize the object. |
pass | A flag indicating which fields to initialize. |
- Returns
static Color ConfigNode.ParseColor |
( |
string |
vectorString | ) |
|
|
static |
static Color32 ConfigNode.ParseColor32 |
( |
string |
vectorString | ) |
|
|
static |
static Enum ConfigNode.ParseEnum |
( |
Type |
enumType, |
|
|
string |
vectorString |
|
) |
| |
|
static |
static Matrix4x4 ConfigNode.ParseMatrix4x4 |
( |
string |
quaternionString | ) |
|
|
static |
static Quaternion ConfigNode.ParseQuaternion |
( |
string |
quaternionString | ) |
|
|
static |
static QuaternionD ConfigNode.ParseQuaternionD |
( |
string |
quaternionString | ) |
|
|
static |
static Vector3 ConfigNode.ParseVector2 |
( |
string |
vectorString | ) |
|
|
static |
static Vector3 ConfigNode.ParseVector3 |
( |
string |
vectorString | ) |
|
|
static |
static Vector3d ConfigNode.ParseVector3D |
( |
string |
vectorString | ) |
|
|
static |
static Vector4 ConfigNode.ParseVector4 |
( |
string |
vectorString | ) |
|
|
static |
bool ConfigNode.Save |
( |
string |
fileFullName | ) |
|
Seralize this ConfigNode to a file.
- Parameters
-
fileFullName | A filename (absolute path?) |
- Returns
- ?
bool ConfigNode.Save |
( |
string |
fileFullName, |
|
|
string |
header |
|
) |
| |
bool ConfigNode.SetNode |
( |
string |
name, |
|
|
ConfigNode |
newNode |
|
) |
| |
bool ConfigNode.SetNode |
( |
string |
name, |
|
|
ConfigNode |
newNode, |
|
|
int |
index |
|
) |
| |
bool ConfigNode.SetValue |
( |
string |
name, |
|
|
string |
newValue |
|
) |
| |
bool ConfigNode.SetValue |
( |
string |
name, |
|
|
string |
newValue, |
|
|
int |
index |
|
) |
| |
override string ConfigNode.ToString |
( |
| ) |
|
static string ConfigNode.WriteColor |
( |
Color |
color | ) |
|
|
static |
static string ConfigNode.WriteColor |
( |
Color32 |
color | ) |
|
|
static |
static string ConfigNode.WriteEnum |
( |
Enum |
en | ) |
|
|
static |
static string ConfigNode.WriteMatrix4x4 |
( |
Matrix4x4 |
matrix | ) |
|
|
static |
static string ConfigNode.WriteQuaternion |
( |
Quaternion |
quaternion | ) |
|
|
static |
static string ConfigNode.WriteQuaternion |
( |
QuaternionD |
quaternion | ) |
|
|
static |
static string ConfigNode.WriteVector |
( |
Vector2 |
vector | ) |
|
|
static |
static string ConfigNode.WriteVector |
( |
Vector3 |
vector | ) |
|
|
static |
static string ConfigNode.WriteVector |
( |
Vector3d |
vector | ) |
|
|
static |
static string ConfigNode.WriteVector |
( |
Vector4 |
vector | ) |
|
|
static |
const string ConfigNode.configTabIndent = @" " |
int ConfigNode.CountNodes |
|
get |
int ConfigNode.CountValues |
|
get |
The documentation for this class was generated from the following file: