Class XMLManager
Read XML files from disk for modding purposes
Assembly: Assembly-CSharp.dll
Syntax
Constructors
|
Improve this Doc
View Source
XMLManager(TextReader)
Declaration
public XMLManager(TextReader textReader)
Parameters
|
Improve this Doc
View Source
XMLManager(String)
Declaration
public XMLManager(string path)
Parameters
Type |
Name |
Description |
String |
path |
|
Methods
|
Improve this Doc
View Source
GetBool(String, Boolean)
Declaration
public bool GetBool(string key, bool defaultValue = false)
Parameters
Returns
|
Improve this Doc
View Source
GetColor(Color)
Declaration
public Color GetColor(Color baseColor)
Parameters
Type |
Name |
Description |
Color |
baseColor |
|
Returns
|
Improve this Doc
View Source
GetRect(String, Rect, Single)
Gets a rect and scale all its value to the requested requestedScale
.
The xml element can provide an attribute with a specified scale different than one.
Declaration
public Rect GetRect(string name, Rect baseRect, float requestedScale = 1F)
Parameters
Type |
Name |
Description |
String |
name |
The name of the rect element.
|
Rect |
baseRect |
Default values for the rect.
|
Single |
requestedScale |
A value to scale the rect.
|
Returns
Type |
Description |
Rect |
Rect read from xml file.
|
|
Improve this Doc
View Source
GetVector2(String, String, Vector2)
Declaration
public Vector2 GetVector2(string keyX, string keyY, Vector2 baseVector)
Parameters
Returns
|
Improve this Doc
View Source
GetVector3(String, String, Vector3)
Declaration
public Vector3 GetVector3(string keyX, string keyY, Vector3 baseVector)
Parameters
Returns
|
Improve this Doc
View Source
TryGetColor(Single, out Color)
Declaration
public bool TryGetColor(float defaultAlpha, out Color color)
Parameters
Returns
|
Improve this Doc
View Source
TryGetColor(out Color)
Declaration
public bool TryGetColor(out Color color)
Parameters
Type |
Name |
Description |
Color |
color |
|
Returns
|
Improve this Doc
View Source
TryGetFloat(String, out Single)
Declaration
public bool TryGetFloat(string key, out float value)
Parameters
Returns
|
Improve this Doc
View Source
TryGetString(String, out String)
Declaration
public bool TryGetString(string key, out string value)
Parameters
Returns
|
Improve this Doc
View Source
TryGetVector2(String, String, out Vector2)
Declaration
public bool TryGetVector2(string keyX, string keyY, out Vector2 vector)
Parameters
Returns
|
Improve this Doc
View Source
TryReadXml(String, String, out XMLManager)
Seek xml from modding locations.
Declaration
public static bool TryReadXml(string directory, string name, out XMLManager xml)
Parameters
Type |
Name |
Description |
String |
directory |
Directory on disk (loose files only).
|
String |
name |
Name of xml.
|
XMLManager |
xml |
XMLManager instance from imported xml.
|
Returns
Type |
Description |
Boolean |
True if xml found and read.
|
|
Improve this Doc
View Source
XmlFileExists(String)
Loose files contain xml ?
Declaration
public static bool XmlFileExists(string path)
Parameters
Type |
Name |
Description |
String |
path |
Path to xml.
|
Returns
Type |
Description |
Boolean |
True if xml file exists.
|