Skip to content

Instantly share code, notes, and snippets.

@tsubaki
Created July 30, 2017 03:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tsubaki/33f993044cc8b306bea4523f858650cf to your computer and use it in GitHub Desktop.
Save tsubaki/33f993044cc8b306bea4523f858650cf to your computer and use it in GitHub Desktop.
Outputを複数持ったPlayableGraph
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Playables;
using UnityEngine.Animations;
public class ACon : MonoBehaviour
{
PlayableGraph graph;
[SerializeField] Animator[] animators;
[SerializeField] AnimationClip clip;
void Awake()
{
graph = PlayableGraph.Create ();
}
void Start()
{
var clipPlayable = AnimationClipPlayable.Create (graph, clip);
foreach (var anim in animators) {
var output = AnimationPlayableOutput.Create (graph, anim.name, anim);
output.SetSourcePlayable (clipPlayable);
}
graph.Play ();
}
void OnDestroy()
{
graph.Destroy ();
}
}
@tsubaki
Copy link
Author

tsubaki commented Jul 30, 2017

animation 103
12 41 31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment