public override void Execute() { GameObject obj = GameObjectManager.FindGameObject(gameObjectID); if (obj != null && componentID != "None") { ObjectComponent comp = obj.FindComponent(componentID); if (comp != null) { Type t = comp.GetType(); PropertyInfo prop = t.GetProperty(propertyName); if (prop != null && prop.PropertyType == value.GetType()) { prop.SetValue(comp, value, null); } } } else if (obj != null) { Type t = obj.GetType(); PropertyInfo prop = t.GetProperty(propertyName); if (prop != null && prop.PropertyType == value.GetType()) { prop.SetValue(obj, value, null); } } FinishExecution(); }
public override void Execute() { GameObject obj = GameObjectManager.FindGameObject(gameObjectID); if (obj != null && componentID != "None") { ObjectComponent comp = obj.FindComponent(componentID); if (comp != null) { Type t = comp.GetType(); MethodInfo info = t.GetMethod(methodName); if (info != null) { info.Invoke(comp, parameters); } } } else if (obj != null) { Type t = obj.GetType(); MethodInfo info = t.GetMethod(methodName); if (info != null) { info.Invoke(obj, parameters); } } FinishExecution(); }