Created
June 1, 2020 13:36
-
-
Save SiunCyclone/e6c582c95c6c44c540fba946390ade8a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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