Skip to content

Instantly share code, notes, and snippets.

@mfmfuyu
Created June 23, 2022 09:54
Show Gist options
  • Save mfmfuyu/8b9ad244031ca97b8ef05dcd574001e3 to your computer and use it in GitHub Desktop.
Save mfmfuyu/8b9ad244031ca97b8ef05dcd574001e3 to your computer and use it in GitHub Desktop.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Playables;
public class NewBehaviourScript : MonoBehaviour
{
[SerializeField]
float speed = 1.0f;
private PlayableDirector playableDirector;
// Start is called before the first frame update
void Start()
{
this.playableDirector = gameObject.GetComponent<PlayableDirector>();
this.playableDirector.playableGraph.GetRootPlayable(0).SetSpeed(speed);
}
// Update is called once per frame
void Update()
{
this.playableDirector.playableGraph.GetRootPlayable(0).SetSpeed(speed);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment