5 namespace HKI.Core.Variables
15 [CreateAssetMenu(fileName =
"String", menuName =
"HKI/Variables/String", order = 4)]
19 public override void Save(XmlNode parentNode)
21 XmlNode node = parentNode.OwnerDocument.CreateElement(name.Replace(
" ",
""));
22 parentNode.AppendChild(node);
24 XmlAttribute valueAttribute = parentNode.OwnerDocument.CreateAttribute(
"Value");
25 valueAttribute.Value = Value;
26 node.Attributes.Append(valueAttribute);
29 public override void Load(XmlNode node)
31 if (node.Attributes == null)
33 Debug.LogError(
"(String) >" + name +
"< Loading failed because this XmlNode has not attributes!");
37 XmlAttribute valueAttribute = node.Attributes[
"Value"];
38 if (valueAttribute == null)
40 Debug.LogError(
"(String) >" + name +
"< Loading failed because this XmlNode has not an attribute with the name >Value<!");
44 SetValue = valueAttribute.Value;
override void Save(XmlNode parentNode)
override void Load(XmlNode node)
Implementation of a string value as a HKIVar via HKIVarGeneric.
This class adds a generic implementation to HKIVar. This reduces the repetitive implementation of thi...