예제 #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;
        }