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

25 lines
668 B
C#
Raw Normal View History

2021-12-26 21:05:07 -08:00
using UnityEngine;
2021-04-26 14:30:21 +01:00
namespace QSB.Animation.Player
{
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)
{
2021-12-26 20:35:40 -08:00
SuitedAnimController = playerAnimController._baseAnimController;
2020-12-02 21:23:01 +00:00
}
}
}
2020-11-08 16:13:10 +00:00
}