コード例 #1
0
        private bool DrawEvent(AnimationEvent animationEvent, AnimationState containingState)
        {
            bool shouldDelete = false;

            EditorGUI.BeginChangeCheck();
            EditorUtilities.DrawHorizontal(() =>
            {
                EditorGUILayout.LabelField("name", GUILayout.Width(50f));
                animationEvent.name = EditorGUILayout.TextField(animationEvent.name);
            });
            EditorUtilities.DrawHorizontal(() =>
            {
                EditorGUILayout.LabelField("time", GUILayout.Width(50f));
                animationEvent.time = EditorGUILayout.Slider((float)animationEvent.time, 0f, containingState.Duration);
            });
            EditorUtilities.DrawHorizontal(() =>
            {
                GUILayout.FlexibleSpace();
                if (GUILayout.Button($"Delete '{animationEvent.name}'"))
                {
                    shouldDelete = true;
                }
            });
            if (EditorGUI.EndChangeCheck())
            {
                EditorUtilities.SetDirty(animationPlayer);
            }

            return(shouldDelete);
        }
コード例 #2
0
 public void MarkDirty()
 {
     stateNamesNeedsUpdate = true;
     metaDataDrawer.usedClipsNeedsUpdate = true;
     EditorUtilities.SetDirty(animationPlayer);
 }