public override void OnCreate(SequenceBehaviour sequence, IReadOnlyList <Blackboard> blackboards) { m_Graph = ((PlayableSequence)sequence).Graph; Blackboard.Bind(blackboards, m_Clip); }
public override IAnimGraphInstance Instatiate(EntityManager entityManager, Entity owner, PlayableGraph graph, Entity animStateOwner) { var animator = entityManager.GetComponentObject <Animator>(owner); var skeleton = entityManager.GetComponentObject <Skeleton>(owner); return(new TwoBoneIkAnimNode(animator, skeleton, graph, this)); }
public override Playable CreatePlayable(PlayableGraph graph, GameObject owner) { var playable = ScriptPlayable <Subtitle2Behaviour> .Create(graph); return(playable); }
public override IAnimGraphInstance Instatiate(EntityManager entityManager, Entity owner, PlayableGraph graph, Entity animStateOwner) { var animState = new Instance(entityManager, owner, graph, animStateOwner, this); return(animState); }
protected override Playable OnCreateArgumentPlayable(PlayableGraph graph, GameObject go, int inputCount) { return(ScriptPlayable <TimeScalePlayableBehaviour> .Create(graph, inputCount)); }
protected override Playable CreateTrackMixerInternal(PlayableGraph graph, GameObject go, int inputCount) { return Playable.Create(graph, inputCount); }
public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount) { return(ScriptPlayable <SubtitleTrackMixer> .Create(graph, inputCount)); }
public override Playable CreateTrackMixer(PlayableGraph graph, GameObject gameObject, int inputCount) { return(AlembicMixerPlayable.Create(graph, gameObject, inputCount, this)); }
public override Playable CreatePlayable(PlayableGraph graph, GameObject owner) { return(ScriptPlayable <TextControlBehaviour> .Create(graph, template)); }
public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount) { return(ScriptPlayable <EZTransformPositionMixer> .Create(graph, inputCount)); }
public override Playable CreatePlayable(PlayableGraph graph, GameObject owner) { return(Playable.Null); }
public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount) { return(ScriptPlayable <ContinueConversationMixerBehaviour> .Create(graph, inputCount)); }
void OnDestroyingGraph(PlayableGraph graph) { m_Graphs.Remove(graph); }
// Start is called before the first frame update void Start() { graph = PlayableGraph.Create(name); if (m_maxSpringJoint <= 0) { m_maxSpringJoint = 4; } // points. m_SphereGameObjects = new GameObject[m_maxSpringJoint]; for (int ii = 0; ii < m_maxSpringJoint; ii++) { m_SphereGameObjects[ii] = GameObject.CreatePrimitive(PrimitiveType.Sphere); m_SphereGameObjects[ii].layer = 8; // todo. m_SphereGameObjects[ii].transform.position = new Vector3(0.0f, floorPositionY - (float)ii, 0.0f); m_SphereGameObjects[ii].name = "joint" + ii; if (GameObjectMaterial != null) { var renderer = m_SphereGameObjects[ii].GetComponent <MeshRenderer>(); renderer.material = GameObjectMaterial; } } #if false // capusles. m_CapsuleGameObjects = new GameObject[m_maxSpringJoint - 1]; for (int ii = 0; ii < m_maxSpringJoint - 1; ii++) { m_CapsuleGameObjects[ii] = GameObject.CreatePrimitive(PrimitiveType.Capsule); m_CapsuleGameObjects[ii].transform.position = new Vector3(0.0f, -0.5f + (float)-ii, 0.0f); } #endif m_rootGameObject = new GameObject(); // Parent-child relationship. #if false for (int ii = 1; ii < m_maxSpringJoint; ii++) { m_SphereGameObjects[ii].transform.parent = m_SphereGameObjects[ii - 1].transform; } if (m_CapsuleGameObjects != null) { for (int ii = 0; ii < m_maxSpringJoint - 1; ii++) { m_CapsuleGameObjects[ii].transform.parent = m_SphereGameObjects[ii].transform; } } var animator = m_SphereGameObjects[0].AddComponent <Animator>(); UnityEngine.AvatarBuilder.BuildGenericAvatar( m_SphereGameObjects[0], m_SphereGameObjects[0].name); #else for (int ii = 0; ii < m_maxSpringJoint; ii++) { m_SphereGameObjects[ii].transform.parent = m_rootGameObject.transform; } var animator = m_rootGameObject.AddComponent <Animator>(); UnityEngine.AvatarBuilder.BuildGenericAvatar( m_rootGameObject, m_rootGameObject.name); #endif joints = new NativeArray <TransformStreamHandle>(m_maxSpringJoint, Allocator.Persistent); for (int ii = 0; ii < m_maxSpringJoint; ii++) { joints[ii] = animator.BindStreamTransform(m_SphereGameObjects[ii].transform); } // AnimatorUtility.OptimizeTransformHierarchy(m_SphereGameObjects[0], null); #if false effectors = new NativeArray <TransformSceneHandle>(m_maxSpringJoint, Allocator.Persistent); for (int ii = 0; ii < m_maxSpringJoint; ii++) { effectors[ii] = animator.BindSceneTransform(new GameObject().transform); } ; #endif // targetEffector = animator.BindSceneTransform(m_targetGameObject.transform); job = new AnimationJob() { // effectors = effectors, joints = joints, floorPositionY = floorPositionY, rootOffset = rootOffset, restLength = restLength, hangGameObjectFlag = HangGameObject ? 1:0, // targetEffector = targetEffector, }; job.SetUp(); var playable = AnimationScriptPlayable.Create(graph, job); AnimationPlayableUtilities.Play(animator, playable, graph); }
public static AnimationPosePlayable Create(PlayableGraph graph) { var handle = CreateHandle(graph); return(new AnimationPosePlayable(handle)); }
private void Awake() { graph = PlayableGraph.Create(); }
} // 0x00792480-0x00792500 // Methods public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount) => default; // 0x00792350-0x00792480
public override Playable CreatePlayable(PlayableGraph graph, GameObject owner) { return(ScriptPlayable <PlayableShaderGlobalBehaviour> .Create(graph, data)); }
public override Playable CreatePlayable(PlayableGraph graph, GameObject owner) { var playable = ScriptPlayable <LightShowBehaviour> .Create(graph, Template); return(playable); }
// Create the runtime version of the clip, by creating a copy of the template public override Playable CreatePlayable(PlayableGraph graph, GameObject go) { return(ScriptPlayable <VignettePlayable> .Create(graph, vignettePlayable)); }
public override Playable CreatePlayable(PlayableGraph graph, GameObject owner) { return(ScriptPlayable <SceneReloaderBehaviour> .Create(graph, template)); }
public void Initialize(Playable owner, PlayableGraph graph) { Mixer = AnimationMixerPlayable.Create(graph); owner.AddInput(Mixer, 0, 1.0f); }
public override Playable CreatePlayable(PlayableGraph graph, GameObject owner) { return(ScriptPlayable <NoiseBehaviour> .Create(graph, noise)); }
public override Playable CreatePlayable(PlayableGraph graph, GameObject go) { return(Playable.Create(graph, 0)); }
public override Playable CreatePlayable(PlayableGraph graph, GameObject owner) { var playable = ScriptPlayable <ScreenFaderBehaviour> .Create(graph, template); return(playable); }
void Awake() { m_graph = PlayableGraph.Create(); }
public SynchronizeObject(Animator animator, AnimationClip clip) { this.animator = animator; gameObject = animator.gameObject; transformPoseSave = new TransformPoseSave(gameObject); blendShapeWeightSave = new BlendShapeWeightSave(gameObject); animationClipValueSave = new AnimationClipValueSave(gameObject, clip); this.clip = clip; #if UNITY_2018_3_OR_NEWER #region BuildPlayableGraph { m_PlayableGraph = PlayableGraph.Create("SynchronizeObject." + gameObject.name); m_PlayableGraph.SetTimeUpdateMode(DirectorUpdateMode.Manual); m_AnimationClipPlayable = AnimationClipPlayable.Create(m_PlayableGraph, clip); m_AnimationClipPlayable.SetApplyPlayableIK(false); m_AnimationClipPlayable.SetApplyFootIK(false); { UAnimationClipPlayable uAnimationClipPlayable = new UAnimationClipPlayable(); uAnimationClipPlayable.SetRemoveStartOffset(m_AnimationClipPlayable, true); } Playable rootPlayable = m_AnimationClipPlayable; #if VERYANIMATION_ANIMATIONRIGGING m_VARigBuilder = gameObject.GetComponent <VeryAnimationRigBuilder>(); m_RigBuilder = gameObject.GetComponent <RigBuilder>(); if (m_VARigBuilder != null && m_RigBuilder != null) { m_VARigBuilder.StartPreview(); m_RigBuilder.StartPreview(); rootPlayable = m_VARigBuilder.BuildPreviewGraph(m_PlayableGraph, rootPlayable); rootPlayable = m_RigBuilder.BuildPreviewGraph(m_PlayableGraph, rootPlayable); } #endif if (animator.applyRootMotion) { bool hasRootMotionBone = false; if (animator.isHuman) { hasRootMotionBone = true; } else { UAvatar uAvatar = new UAvatar(); var genericRootMotionBonePath = uAvatar.GetGenericRootMotionBonePath(animator.avatar); hasRootMotionBone = !string.IsNullOrEmpty(genericRootMotionBonePath); } if (hasRootMotionBone) { var uAnimationOffsetPlayable = new UAnimationOffsetPlayable(); m_AnimationOffsetPlayable = uAnimationOffsetPlayable.Create(m_PlayableGraph, transformPoseSave.startLocalPosition, transformPoseSave.startLocalRotation, 1); m_AnimationOffsetPlayable.SetInputWeight(0, 1f); m_PlayableGraph.Connect(rootPlayable, 0, m_AnimationOffsetPlayable, 0); rootPlayable = m_AnimationOffsetPlayable; } { var uAnimationMotionXToDeltaPlayable = new UAnimationMotionXToDeltaPlayable(); m_AnimationMotionXToDeltaPlayable = uAnimationMotionXToDeltaPlayable.Create(m_PlayableGraph); uAnimationMotionXToDeltaPlayable.SetAbsoluteMotion(m_AnimationMotionXToDeltaPlayable, true); m_AnimationMotionXToDeltaPlayable.SetInputWeight(0, 1f); m_PlayableGraph.Connect(rootPlayable, 0, m_AnimationMotionXToDeltaPlayable, 0); rootPlayable = m_AnimationMotionXToDeltaPlayable; } } var playableOutput = AnimationPlayableOutput.Create(m_PlayableGraph, "Animation", animator); playableOutput.SetSourcePlayable(rootPlayable); } #endregion #else animator.enabled = false; //In order to avoid the mysterious behavior where an event is called from "UnityEditor.Handles: DrawCameraImpl", it is invalid except when updating #endif #region Save saveFireEvents = animator.fireEvents; animator.fireEvents = false; #endregion }
extern private static bool CreateHandleInternal(PlayableGraph graph, ref PlayableHandle handle);
public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount) { return(ScriptPlayable <SpineAnimationStateMixerBehaviour> .Create(graph, inputCount)); }
public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount) { return(base.CreateTrackMixer(graph, go, inputCount)); }