public void ReplaceParameterAt(ParameterType newValue, int index)
		{
			ReplaceDomElementAt("", "Parameter", index, newValue);
		}
		public void InsertParameterAt(ParameterType newValue, int index)
		{
			InsertDomElementAt("", "Parameter", index, newValue);
		}
			public ValueEnumerator(ParameterType par) 
			{
				parent = par;
				nIndex = -1;
			}
		public void AddParameter(ParameterType newValue)
		{
			AppendDomElement("", "Parameter", newValue);
		}
示例#5
0
        public static bool Save(BaseScript script, out ScriptReference xmlScriptReference)
        {
            xmlScriptReference = new ScriptReference();

            xmlScriptReference.AddScriptName(new SchemaString(script.GetType().ToString()));

            foreach (FieldInfo field in script.m_Fields)
            {
                ParameterType parameter = new ParameterType();

                parameter.AddName(new SchemaString(field.Name));
                parameter.AddType2(new SchemaString(field.FieldType.ToString()));

                object value = field.GetValue(script);
                if (value != null)
                    parameter.AddValue(Variable.GetConstantFromValue(value));
                else
                    Debug.LogError("Error saving value for field " + field.Name + " in script " + script.GetType().ToString());

                xmlScriptReference.AddParameter(parameter);
            }

            return true;
        }