Last active
June 1, 2020 09:18
-
-
Save SiunCyclone/a01cc12e076c75d9706f6dd6fa3bbd46 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
public void Initialize(EntityManager entityManager, Entity owner, Entity character) { | |
m_Animator = entityManager.GetComponentObject<Animator>(owner); | |
m_Animator.fireEvents = fireAnimationEvents; | |
m_PlayableGraph = PlayableGraph.Create(name); | |
m_animGraph = animStateDefinition.Instatiate(entityManager, owner, m_PlayableGraph, character); | |
m_animGraphLogic = m_animGraph as IGraphLogic; | |
m_PlayableGraph.Play(); | |
var outputPlayable = Playable.Null; | |
var outputPort = 0; | |
m_animGraph.GetPlayableOutput(0, ref outputPlayable, ref outputPort); | |
// Set graph output | |
var animationOutput = AnimationPlayableOutput.Create(m_PlayableGraph, "Animator", m_Animator); | |
animationOutput.SetSourcePlayable(outputPlayable); | |
animationOutput.SetSourceOutputPort(outputPort); | |
} | |
IAnimGraphInstance m_animGraph; | |
IGraphLogic m_animGraphLogic; | |
Animator m_Animator; | |
PlayableGraph m_PlayableGraph; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment