public void WriteAllMuscleValue() { if (curveBindings == null) { OnTargetChange(); } if (clip == null || curveBindings == null) { PSLogger.Error("Clip or curveBindings is null"); return; } if (this.propertyMuscleName.Length > curveBindings.Length) { PSLogger.Error("CurveBindings length and propertyMuscleName length are not equal"); return; } Undo.RecordObject(clip, clip.name); for (int i = 0, len = this.propertyMuscleName.Length; i < len; i++) { if (muscleToggle [i]) { this.SetEditorCurve(curveBindings [i], muscleValue [i]); } else { AnimationUtility.SetEditorCurve(clip, curveBindings [i], null); } } resample = true; }
public void WriteMuscleValue(int index, float value) { if (curveBindings == null) { OnTargetChange(); } if (clip == null || curveBindings == null) { PSLogger.Error("Clip or curveBindings is null"); return; } if (index >= curveBindings.Length) { PSLogger.Error("Array index is out of range"); return; } Undo.RecordObject(clip, clip.name); if (muscleToggle [index]) { this.SetEditorCurve(curveBindings [index], value); } else { AnimationUtility.SetEditorCurve(clip, curveBindings [index], null); } resample = true; }