quantum-space-buddies/QSB/Animation/AnimControllerPatch.cs

26 lines
718 B
C#
Raw Normal View History

2020-12-20 10:56:15 +00:00
using OWML.Utils;
using UnityEngine;
namespace QSB.Animation
{
2020-12-02 21:23:01 +00:00
public static class AnimControllerPatch
{
public static RuntimeAnimatorController SuitedAnimController { get; private set; }
2020-12-02 21:23:01 +00:00
public static void Init()
{
2020-12-14 16:24:52 +00:00
QSBCore.Helper.Events.Subscribe<PlayerAnimController>(OWML.Common.Events.BeforeStart);
QSBCore.Helper.Events.Event += OnEvent;
2020-12-02 21:23:01 +00:00
}
2020-12-02 21:23:01 +00:00
private static void OnEvent(MonoBehaviour behaviour, OWML.Common.Events ev)
{
if (behaviour is PlayerAnimController playerAnimController &&
ev == OWML.Common.Events.BeforeStart &&
SuitedAnimController == null)
{
SuitedAnimController = playerAnimController.GetValue<RuntimeAnimatorController>("_baseAnimController");
}
}
}
2020-11-08 16:13:10 +00:00
}