public string getValueString(bool brief) { string s = ""; if (AMPropertyTrack.isValueTypeNumeric(valueType)) { //s+= start_val.ToString(); s += formatNumeric(start_val); if (!brief && endFrame != -1) { s += " -> " + formatNumeric(end_val); } //if(!brief && endFrame != -1) s += " -> "+end_val.ToString(); } else if (valueType == (int)AMPropertyTrack.ValueType.Vector2) { s += start_vect2.ToString(); if (!brief && endFrame != -1) { s += " -> " + end_vect2.ToString(); } } else if (valueType == (int)AMPropertyTrack.ValueType.Vector3) { s += start_vect3.ToString(); if (!brief && endFrame != -1) { s += " -> " + end_vect3.ToString(); } } else if (valueType == (int)AMPropertyTrack.ValueType.Color) { //return null; s += start_color.ToString(); if (!brief && endFrame != -1) { s += " -> " + end_color.ToString(); } } else if (valueType == (int)AMPropertyTrack.ValueType.Rect) { //return null; s += start_rect.ToString(); if (!brief && endFrame != -1) { s += " -> " + end_rect.ToString(); } } else if (valueType == (int)AMPropertyTrack.ValueType.String) { s += start_str; } return(s); }
public override void execute(int frameRate, float delay) { if (targetsAreEqual()) { return; } if ((endFrame == -1) || !component || ((fieldInfo == null) && (propertyInfo == null) && (methodInfo == null))) { return; } if (fieldInfo != null) { if (hasCustomEase()) { if (AMPropertyTrack.isValueTypeNumeric(valueType)) { AMTween.PropertyTo(component, AMTween.Hash("delay", getWaitTime(frameRate, delay), "time", getTime(frameRate), "fieldinfo", fieldInfo, "from", start_val, "to", end_val, "easecurve", easeCurve)); } if (valueType == (int)AMPropertyTrack.ValueType.Vector2) { AMTween.PropertyTo(component, AMTween.Hash("delay", getWaitTime(frameRate, delay), "time", getTime(frameRate), "fieldinfo", fieldInfo, "from", start_vect2, "to", end_vect2, "easecurve", easeCurve)); } if (valueType == (int)AMPropertyTrack.ValueType.Vector3) { AMTween.PropertyTo(component, AMTween.Hash("delay", getWaitTime(frameRate, delay), "time", getTime(frameRate), "fieldinfo", fieldInfo, "from", start_vect3, "to", end_vect3, "easecurve", easeCurve)); } if (valueType == (int)AMPropertyTrack.ValueType.Color) { AMTween.PropertyTo(component, AMTween.Hash("delay", getWaitTime(frameRate, delay), "time", getTime(frameRate), "fieldinfo", fieldInfo, "from", start_color, "to", end_color, "easecurve", easeCurve)); } if (valueType == (int)AMPropertyTrack.ValueType.Rect) { AMTween.PropertyTo(component, AMTween.Hash("delay", getWaitTime(frameRate, delay), "time", getTime(frameRate), "fieldinfo", fieldInfo, "from", start_vect2, "to", end_vect2, "easecurve", easeCurve)); } if (valueType == (int)AMPropertyTrack.ValueType.String) { CoroutineBehaviour.StartCoroutineDelay(component.gameObject, (x) => { fieldInfo.SetValue(component, start_str); }, getWaitTime(frameRate, delay)); } } else { if (AMPropertyTrack.isValueTypeNumeric(valueType)) { AMTween.PropertyTo(component, AMTween.Hash("delay", getWaitTime(frameRate, delay), "time", getTime(frameRate), "fieldinfo", fieldInfo, "from", start_val, "to", end_val, "easetype", (AMTween.EaseType)easeType)); } if (valueType == (int)AMPropertyTrack.ValueType.Vector2) { AMTween.PropertyTo(component, AMTween.Hash("delay", getWaitTime(frameRate, delay), "time", getTime(frameRate), "fieldinfo", fieldInfo, "from", start_vect2, "to", end_vect2, "easetype", (AMTween.EaseType)easeType)); } if (valueType == (int)AMPropertyTrack.ValueType.Vector3) { AMTween.PropertyTo(component, AMTween.Hash("delay", getWaitTime(frameRate, delay), "time", getTime(frameRate), "fieldinfo", fieldInfo, "from", start_vect3, "to", end_vect3, "easetype", (AMTween.EaseType)easeType)); } if (valueType == (int)AMPropertyTrack.ValueType.Color) { AMTween.PropertyTo(component, AMTween.Hash("delay", getWaitTime(frameRate, delay), "time", getTime(frameRate), "fieldinfo", fieldInfo, "from", start_color, "to", end_color, "easetype", (AMTween.EaseType)easeType)); } if (valueType == (int)AMPropertyTrack.ValueType.Rect) { AMTween.PropertyTo(component, AMTween.Hash("delay", getWaitTime(frameRate, delay), "time", getTime(frameRate), "fieldinfo", fieldInfo, "from", start_vect2, "to", end_vect2, "easetype", (AMTween.EaseType)easeType)); } if (valueType == (int)AMPropertyTrack.ValueType.String) { CoroutineBehaviour.StartCoroutineDelay(component.gameObject, SetStringFunc, getWaitTime(frameRate, delay)); } } } else if (propertyInfo != null) { if (hasCustomEase()) { if (AMPropertyTrack.isValueTypeNumeric(valueType)) { AMTween.PropertyTo(component, AMTween.Hash("delay", getWaitTime(frameRate, delay), "time", getTime(frameRate), "propertyinfo", propertyInfo, "from", start_val, "to", end_val, "easecurve", easeCurve)); } if (valueType == (int)AMPropertyTrack.ValueType.Vector2) { AMTween.PropertyTo(component, AMTween.Hash("delay", getWaitTime(frameRate, delay), "time", getTime(frameRate), "propertyinfo", propertyInfo, "from", start_vect2, "to", end_vect2, "easecurve", easeCurve)); } if (valueType == (int)AMPropertyTrack.ValueType.Vector3) { AMTween.PropertyTo(component, AMTween.Hash("delay", getWaitTime(frameRate, delay), "time", getTime(frameRate), "propertyinfo", propertyInfo, "from", start_vect3, "to", end_vect3, "easecurve", easeCurve)); } if (valueType == (int)AMPropertyTrack.ValueType.Color) { AMTween.PropertyTo(component, AMTween.Hash("delay", getWaitTime(frameRate, delay), "time", getTime(frameRate), "propertyinfo", propertyInfo, "from", start_color, "to", end_color, "easecurve", easeCurve)); } if (valueType == (int)AMPropertyTrack.ValueType.Rect) { AMTween.PropertyTo(component, AMTween.Hash("delay", getWaitTime(frameRate, delay), "time", getTime(frameRate), "propertyinfo", propertyInfo, "from", start_vect2, "to", end_vect2, "easecurve", easeCurve)); } if (valueType == (int)AMPropertyTrack.ValueType.String) { CoroutineBehaviour.StartCoroutineDelay(component.gameObject, (x) => { propertyInfo.SetValue(component, start_str, null); }, getWaitTime(frameRate, delay)); } } else { if (AMPropertyTrack.isValueTypeNumeric(valueType)) { AMTween.PropertyTo(component, AMTween.Hash("delay", getWaitTime(frameRate, delay), "time", getTime(frameRate), "propertyinfo", propertyInfo, "from", start_val, "to", end_val, "easetype", (AMTween.EaseType)easeType)); } if (valueType == (int)AMPropertyTrack.ValueType.Vector2) { AMTween.PropertyTo(component, AMTween.Hash("delay", getWaitTime(frameRate, delay), "time", getTime(frameRate), "propertyinfo", propertyInfo, "from", start_vect2, "to", end_vect2, "easetype", (AMTween.EaseType)easeType)); } if (valueType == (int)AMPropertyTrack.ValueType.Vector3) { AMTween.PropertyTo(component, AMTween.Hash("delay", getWaitTime(frameRate, delay), "time", getTime(frameRate), "propertyinfo", propertyInfo, "from", start_vect3, "to", end_vect3, "easetype", (AMTween.EaseType)easeType)); } if (valueType == (int)AMPropertyTrack.ValueType.Color) { AMTween.PropertyTo(component, AMTween.Hash("delay", getWaitTime(frameRate, delay), "time", getTime(frameRate), "propertyinfo", propertyInfo, "from", start_color, "to", end_color, "easetype", (AMTween.EaseType)easeType)); } if (valueType == (int)AMPropertyTrack.ValueType.Rect) { AMTween.PropertyTo(component, AMTween.Hash("delay", getWaitTime(frameRate, delay), "time", getTime(frameRate), "propertyinfo", propertyInfo, "from", start_vect2, "to", end_vect2, "easetype", (AMTween.EaseType)easeType)); } if (valueType == (int)AMPropertyTrack.ValueType.String) { CoroutineBehaviour.StartCoroutineDelay(component.gameObject, (x) => { propertyInfo.SetValue(component, start_str, null); }, getWaitTime(frameRate, delay)); } } } else if (methodInfo != null) { if (hasCustomEase()) { if (valueType == (int)AMPropertyTrack.ValueType.MorphChannels) { AMTween.PropertyTo(component, AMTween.Hash("delay", getWaitTime(frameRate, delay), "time", getTime(frameRate), "methodtype", "morph", "methodinfo", methodInfo, "from", start_morph.ToArray(), "to", end_morph.ToArray(), "easecurve", easeCurve)); } } else { if (valueType == (int)AMPropertyTrack.ValueType.MorphChannels) { AMTween.PropertyTo(component, AMTween.Hash("delay", getWaitTime(frameRate, delay), "time", getTime(frameRate), "methodtype", "morph", "methodinfo", methodInfo, "from", start_morph.ToArray(), "to", end_morph.ToArray(), "easetype", (AMTween.EaseType)easeType)); } } } else { Debug.LogError("Animator: No FieldInfo or PropertyInfo set."); } }
public override string ToString(int codeLanguage, int frameRate) { if (endFrame == -1 || targetsAreEqual()) { return(null); } string memberInfoType = ""; if (fieldInfo != null) { memberInfoType = "fieldinfo"; } else if (propertyInfo != null) { memberInfoType = "propertyinfo"; } else if (methodInfo != null) { memberInfoType = "methodinfo"; } else { Debug.LogError("Animator: No FieldInfo or PropertyInfo set."); return("( Error: No FieldInfo, PropertyInfo or MethodInfo set. )"); } if (codeLanguage == 0) { // c# if (valueType == (int)AMPropertyTrack.ValueType.MorphChannels) { return("AMTween.PropertyTo(obj.gameObject, AMTween.Hash(\"delay\", " + getWaitTime(frameRate, 0f) + "f, \"time\", " + getTime(frameRate) + "f, \"" + memberInfoType + "\", obj.memberinfo, \"methodtype\", \"morph\", \"from\", " + getFloatArrayString(codeLanguage, start_morph) + ", \"to\", " + getFloatArrayString(codeLanguage, end_morph) + ", " + getEaseString(codeLanguage) + "));"); } if (AMPropertyTrack.isValueTypeNumeric(valueType)) { return("AMTween.PropertyTo(obj.gameObject, AMTween.Hash(\"delay\", " + getWaitTime(frameRate, 0f) + "f, \"time\", " + getTime(frameRate) + "f, \"" + memberInfoType + "\", obj.memberinfo, \"from\", " + start_val + "f,\"to\", " + end_val + "f, " + getEaseString(codeLanguage) + "));"); } if (valueType == (int)AMPropertyTrack.ValueType.Vector2) { return("AMTween.PropertyTo(obj.gameObject, AMTween.Hash(\"delay\", " + getWaitTime(frameRate, 0f) + "f, \"time\", " + getTime(frameRate) + "f, \"" + memberInfoType + "\", obj.memberinfo, \"from\", new Vector2(" + start_vect2.x + "f, " + start_vect2.y + "f), \"to\", new Vector2(" + end_vect2.x + "f, " + end_vect2.y + "f), " + getEaseString(codeLanguage) + "));"); } if (valueType == (int)AMPropertyTrack.ValueType.Vector3) { return("AMTween.PropertyTo(obj.gameObject, AMTween.Hash(\"delay\", " + getWaitTime(frameRate, 0f) + "f, \"time\", " + getTime(frameRate) + "f, \"" + memberInfoType + "\", obj.memberinfo, \"from\", new Vector3(" + start_vect3.x + "f, " + start_vect3.y + "f, " + start_vect3.z + "f), \"to\", new Vector3(" + end_vect3.x + "f, " + end_vect3.y + "f, " + end_vect3.z + "f), " + getEaseString(codeLanguage) + "));"); } if (valueType == (int)AMPropertyTrack.ValueType.Color) { return("AMTween.PropertyTo(obj.gameObject, AMTween.Hash(\"delay\", " + getWaitTime(frameRate, 0f) + "f, \"time\", " + getTime(frameRate) + "f, \"" + memberInfoType + "\", obj.memberinfo, \"from\", new Color(" + start_color.r + "f, " + start_color.g + "f, " + start_color.b + "f, " + start_color.a + "f), \"to\", new Color(" + end_color.r + "f, " + end_color.g + "f, " + end_color.b + "f, " + end_color.a + "f), " + getEaseString(codeLanguage) + "));"); } if (valueType == (int)AMPropertyTrack.ValueType.Rect) { return("AMTween.PropertyTo(obj.gameObject, AMTween.Hash(\"delay\", " + getWaitTime(frameRate, 0f) + "f, \"time\", " + getTime(frameRate) + "f, \"" + memberInfoType + "\", obj.memberinfo, \"from\", new Rect(" + start_rect.x + "f, " + start_rect.y + "f, " + start_rect.width + "f, " + start_rect.height + "f), \"to\", new Rect(" + end_rect.x + "f, " + end_rect.y + "f, " + end_rect.width + "f, " + end_rect.height + "f), " + getEaseString(codeLanguage) + "));"); } if (valueType == (int)AMPropertyTrack.ValueType.String) { return("//No code view for AMProperty with string property (<©f¦Ø¡¤)¡î"); } return("( Error: ValueType " + valueType + " not found )"); } else { // js if (valueType == (int)AMPropertyTrack.ValueType.MorphChannels) { return("AMTween.PropertyTo(obj.gameObject, {\"delay\": " + getWaitTime(frameRate, 0f) + ", \"time\": " + getTime(frameRate) + ", \"" + memberInfoType + "\": obj.memberinfo, \"methodtype\": \"morph\", \"from\": " + getFloatArrayString(codeLanguage, start_morph) + ", \"to\": " + getFloatArrayString(codeLanguage, end_morph) + ", " + getEaseString(codeLanguage) + "));"); } if (AMPropertyTrack.isValueTypeNumeric(valueType)) { return("AMTween.PropertyTo(obj.gameObject, {\"delay\": " + getWaitTime(frameRate, 0f) + ", \"time\": " + getTime(frameRate) + ", \"" + memberInfoType + "\": obj.memberinfo, \"from\": " + start_val + ",\"to\": " + end_val + ", " + getEaseString(codeLanguage) + "});"); } if (valueType == (int)AMPropertyTrack.ValueType.Vector2) { return("AMTween.PropertyTo(obj.gameObject, {\"delay\": " + getWaitTime(frameRate, 0f) + ", \"time\": " + getTime(frameRate) + ", \"" + memberInfoType + "\": obj.memberinfo, \"from\": Vector2(" + start_vect2.x + ", " + start_vect2.y + "), \"to\": Vector2(" + end_vect2.x + ", " + end_vect2.y + "), " + getEaseString(codeLanguage) + "});"); } if (valueType == (int)AMPropertyTrack.ValueType.Vector3) { return("AMTween.PropertyTo(obj.gameObject, {\"delay\": " + getWaitTime(frameRate, 0f) + ", \"time\": " + getTime(frameRate) + ", \"" + memberInfoType + "\": obj.memberinfo, \"from\": Vector3(" + start_vect3.x + ", " + start_vect3.y + ", " + start_vect3.z + "), \"to\": Vector3(" + end_vect3.x + ", " + end_vect3.y + ", " + end_vect3.z + "), " + getEaseString(codeLanguage) + "});"); } if (valueType == (int)AMPropertyTrack.ValueType.Color) { return("AMTween.PropertyTo(obj.gameObject, {\"delay\": " + getWaitTime(frameRate, 0f) + ", \"time\": " + getTime(frameRate) + ", \"" + memberInfoType + "\": obj.memberinfo, \"from\": Color(" + start_color.r + ", " + start_color.g + ", " + start_color.b + ", " + start_color.a + "), \"to\": Color(" + end_color.r + ", " + end_color.g + ", " + end_color.b + ", " + end_color.a + "), " + getEaseString(codeLanguage) + "});"); } if (valueType == (int)AMPropertyTrack.ValueType.Rect) { return("AMTween.PropertyTo(obj.gameObject, {\"delay\": " + getWaitTime(frameRate, 0f) + ", \"time\": " + getTime(frameRate) + ", \"" + memberInfoType + "\": obj.memberinfo, \"from\": Rect(" + start_rect.x + ", " + start_rect.y + ", " + start_rect.width + ", " + start_rect.height + "), \"to\": Rect(" + end_rect.x + ", " + end_rect.y + ", " + end_rect.width + ", " + end_rect.height + "), " + getEaseString(codeLanguage) + "});"); } if (valueType == (int)AMPropertyTrack.ValueType.String) { return("//No code view for AMProperty with string property (<©f¦Ø¡¤)¡î"); } return("( Error: ValueType " + valueType + " not found )"); } }