first commit

This commit is contained in:
lethanhsonvsp
2025-11-17 15:16:36 +07:00
commit a40d0921eb
17012 changed files with 2652386 additions and 0 deletions

View File

@@ -0,0 +1,85 @@
using UnityEngine;
namespace UnityEditor.Animations.Rigging
{
[InitializeOnLoad]
static class AnimationWindowUtils
{
static AnimationWindow m_AnimationWindow = null;
public static AnimationWindow animationWindow
{
get
{
if (m_AnimationWindow == null)
m_AnimationWindow = FindWindowOpen();
return m_AnimationWindow;
}
}
public static AnimationClip activeAnimationClip
{
get
{
if (animationWindow != null)
return animationWindow.animationClip;
return null;
}
set
{
if (animationWindow != null)
animationWindow.animationClip = value;
}
}
public static void StartPreview()
{
if (animationWindow != null)
animationWindow.previewing = true;
}
public static void StopPreview()
{
if (animationWindow != null)
animationWindow.previewing = false;
}
public static bool isPreviewing
{
get
{
if (animationWindow != null)
return animationWindow.previewing;
return false;
}
}
// This does not check if there is an AnimationClip to play
public static bool canPreview
{
get
{
if (animationWindow != null)
return animationWindow.canPreview;
return false;
}
}
static AnimationWindow FindWindowOpen()
{
UnityEngine.Object[] objs = Resources.FindObjectsOfTypeAll(typeof(AnimationWindow));
foreach (UnityEngine.Object o in objs)
{
if (o.GetType() == typeof(AnimationWindow))
return (AnimationWindow)o;
}
return null;
}
}
}