public string Get(object target) { LinearForceAffector affector = target as LinearForceAffector; // TODO: Reverse lookup the enum attribute return(affector.ForceApplication.ToString().ToLower()); }
public string Get(object target) { LinearForceAffector affector = target as LinearForceAffector; Vector3 vec = affector.Force; // TODO: Common way for vector string rep, maybe modify ToString return(string.Format("{0} {1} {2}", vec.x, vec.y, vec.z)); }
public void Set(object target, string val) { LinearForceAffector affector = target as LinearForceAffector; // lookup the real enum equivalent to the script value object enumVal = ScriptEnumAttribute.Lookup(val, typeof(ForceApplication)); // if a value was found, assign it if (enumVal != null) { affector.ForceApplication = ((ForceApplication)enumVal); } else { ParseHelper.LogParserError(val, affector.Type, "Invalid enum value");; } }
public void Set(object target, string val) { LinearForceAffector affector = target as LinearForceAffector; affector.Force = StringConverter.ParseVector3(val); }