Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SiunCyclone/e6c582c95c6c44c540fba946390ade8a to your computer and use it in GitHub Desktop.
Save SiunCyclone/e6c582c95c6c44c540fba946390ade8a to your computer and use it in GitHub Desktop.
class Instance : IAnimGraphInstance {
public Instance(EntityManager entityManager, Entity owner, PlayableGraph graph, Entity animStateOwner, AnimGraph_AnimatorController settings) {
m_settings = settings;
m_EntityManager = entityManager;
m_Owner = owner;
m_AnimStateOwner = animStateOwner;
m_characterAnimatorController = new CharacterAnimatorController(graph, m_settings.animatorController);
m_characterAnimatorController.Start();
}
public void Shutdown() {}
public void SetPlayableInput(int index, Playable playable, int playablePort) {}
public void GetPlayableOutput(int index, ref Playable playable, ref int playablePort) {
playable = m_characterAnimatorController.GetRootPlayable();
playablePort = 0;
}
public void ApplyPresentationState(GameTime time, float deltaTime) {
var animState = m_EntityManager.GetComponentData<CharacterInterpolatedData>(m_AnimStateOwner);
m_characterAnimatorController.Update(ref animState);
}
AnimGraph_AnimatorController m_settings;
EntityManager m_EntityManager;
Entity m_Owner;
Entity m_AnimStateOwner;
CharacterAnimatorController m_characterAnimatorController;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment