예제 #1
0
		public bool Load(XMLRules.VariableType variable)
		{
			m_Name = (string)variable.GetName().Value;
			m_Type = (VariableType)variable.GetType2().Value;
			m_Value = GetValueFromConstant((VariableType)variable.GetType2().Value, variable.GetValue());

            if (variable.HasUpdateScript())
            {
                BaseScript updateScript;

				RemoveScript();

                if (BaseScript.Load(variable.GetUpdateScript(), m_GameObject, out updateScript))
                {
                    m_UpdateScriptType = updateScript.GetType();
                    m_UpdateScript = (BaseSensor)updateScript;
                }
            }

			m_IsDirty = true;

			return true;
		}