Пример #1
0
		public void ReplaceParameterAt(ParameterType newValue, int index)
		{
			ReplaceDomElementAt("", "Parameter", index, newValue);
		}
Пример #2
0
		public void InsertParameterAt(ParameterType newValue, int index)
		{
			InsertDomElementAt("", "Parameter", index, newValue);
		}
Пример #3
0
			public ValueEnumerator(ParameterType par) 
			{
				parent = par;
				nIndex = -1;
			}
Пример #4
0
		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;
        }