This repository has been archived on 2026-01-20. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Frontec/Assets/Editor/UIAnimationEditor.cs
jmaniuvc 2936c48466 Frontec
2025-02-24 12:12:52 +09:00

30 lines
730 B
C#

using System;
using UnityEditor;
using UnityEngine;
using UnityEngine.UIElements;
using WIFramework.UI;
[CanEditMultipleObjects]
[CustomEditor(typeof(UISimpleAnimator))]
public class UIAnimationEditor : Editor
{
UISimpleAnimator anim;
private void OnEnable()
{
anim = target as UISimpleAnimator;
}
public override void OnInspectorGUI()
{
base.OnInspectorGUI();
if (GUILayout.Button("SetStartState"))
anim.SaveOrigin();
if (GUILayout.Button("SetTargetState"))
anim.SaveTarget();
if (GUILayout.Button("Reset"))
anim.SetOrigin();
if (GUILayout.Button("PreviewTargetState"))
anim.SetTarget();
}
}