Created
June 23, 2022 09:54
-
-
Save mfmfuyu/8b9ad244031ca97b8ef05dcd574001e3 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
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