public override void OnInspectorGUI() { UTween o = this.target as UTween; EGUIUtility.EnumPop(ProMode, "Mode"); DrawCounter(o); DrawGroupNumber(o); OnDrawChildren(); EditorGUILayout.DelayedFloatField(ProDuration, NAME_DURATION); EditorGUILayout.DelayedFloatField(ProDelayTime, NAME_DELAYTIME); if (ProDuration.floatValue <= 0) { ProDuration.floatValue = 1f; } if (ProDelayTime.floatValue < 0) { ProDelayTime.floatValue = 0; } //Rect rect = new Rect(Vector2.zero, Vector2.one); //rect.xMin = -100; //rect.xMax = 100; //rect.yMin = -100; //rect.yMax = 100; //rect.center = new Vector2(0.5f,0.5f); //rect.x = 0; //rect.y = 0; //EditorGUILayout.CurveField(ProCurve, Color.green, rect, NAME_CURVE, GUILayout.Height(80)); ProCurve.animationCurveValue = EditorGUILayout.CurveField(ProCurve.animationCurveValue, GUILayout.Height(80)); DrawToggle(); serializedObject.ApplyModifiedProperties(); }
void DrawProperty(SerializedProperty o, string _name, Action <UTweenScale> _fillCallback, Action <UTweenScale> _clearCallback) { EditorGUILayout.BeginHorizontal(); EGUIUtility.Vector3Field(o, _name); if (GUILayout.Button("Fill", GUILayout.Width(70))) { foreach (var v in targets) { if (v is UTweenScale) { _fillCallback(v as UTweenScale); } } serializedObject.SetIsDifferentCacheDirty(); } if (GUILayout.Button("Clear", GUILayout.Width(70))) { foreach (var v in targets) { if (v is UTweenScale) { _clearCallback(v as UTweenScale); } } serializedObject.SetIsDifferentCacheDirty(); } EditorGUILayout.EndHorizontal(); }
protected override void OnDrawChildren() { EditorGUILayout.BeginHorizontal(); EGUIUtility.PushButton(ProIsLocal, "Local"); EGUIUtility.PushButton(ProIsSmooth, "Smooth"); EditorGUILayout.EndHorizontal(); DrawProperty(ProFrom, "From", (v) => { if (v.IsLocal) { v.From = v.transform.localRotation; } else { v.From = v.transform.rotation; } }, (v) => v.From = Quaternion.identity); DrawProperty(ProTo, "To", (v) => { if (v.IsLocal) { v.To = v.transform.localRotation; } else { v.To = v.transform.rotation; } }, (v) => v.To = Quaternion.identity); serializedObject.ApplyModifiedProperties(); }
protected override void OnDrawChildren() { GUILayout.BeginHorizontal(); EGUIUtility.PushButton(ProIsLocal, "Local Value", GUILayout.MinWidth(70)); EGUIUtility.PushButton(ProX, "Mask X", GUILayout.Width(70)); EGUIUtility.PushButton(ProY, "Mask Y", GUILayout.Width(70)); EGUIUtility.PushButton(ProZ, "Mask Z", GUILayout.Width(70)); GUILayout.EndHorizontal(); DrawProperty(ProFrom, "From", (v) => { if (v.IsLocal) { v.From = v.transform.localPosition; } else { v.From = v.transform.position; } }, (v) => v.From = Vector3.zero); DrawProperty(ProTo, "To", (v) => { if (v.IsLocal) { v.To = v.transform.localPosition; } else { v.To = v.transform.position; } }, (v) => v.To = Vector3.zero); serializedObject.ApplyModifiedProperties(); }
void DrawToggle() { EditorGUILayout.HelpBox("Options", MessageType.None); EditorGUILayout.BeginHorizontal(); EGUIUtility.PushButton(ProIgnoreTimeScale, "IGNORE SCALE TIME", GUILayout.MinWidth(80)); EGUIUtility.PushButton(ProAutoPlayAwake, "AWAKE PLAY", GUILayout.MinWidth(80)); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); EGUIUtility.PushButton(ProResetEnable, "RESET AT ENABLE", GUILayout.MinWidth(80)); EGUIUtility.PushButton(ProResetPlayCall, "RESET AT PLAYCALL", GUILayout.MinWidth(80)); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); EGUIUtility.PushButton(ProAutoKill, "AUTO KILL", GUILayout.MinWidth(80)); EGUIUtility.PushButton(ProAutoInactive, "AUTO INACTIVE", GUILayout.MinWidth(80)); EditorGUILayout.EndHorizontal(); }
void DrawProperty(SerializedProperty o, string _title, System.Action <UUITweenColor> _callbackFill, System.Action <UUITweenColor> _callbackClear) { EditorGUILayout.BeginHorizontal(); EGUIUtility.ColorField(o, _title); if (GUILayout.Button("Fill")) { foreach (UUITweenColor v in targets) { _callbackFill(v); } } if (GUILayout.Button("Clear")) { foreach (UUITweenColor v in targets) { _callbackClear(v); } } EditorGUILayout.EndHorizontal(); }
protected override void OnDrawChildren() { EGUIUtility.DelayFloatField(ProFrom, NAME_FROM); EGUIUtility.DelayFloatField(ProTo, NAME_TO, NAME_FROM); serializedObject.ApplyModifiedProperties(); }