Skip to content

Instantly share code, notes, and snippets.

@tarukosu
Created November 19, 2017 14:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tarukosu/6ee661d03790a39bc6f4feeb95a317e6 to your computer and use it in GitHub Desktop.
Save tarukosu/6ee661d03790a39bc6f4feeb95a317e6 to your computer and use it in GitHub Desktop.
MenuPanel.cs
using UnityEngine;
using UnityEngine.Playables;
public class MenuPanel : MonoBehaviour {
public PlayableAsset OpenTimeline;
public PlayableAsset CloseTimeline;
private PlayableDirector playableDirector;
void Start () {
playableDirector = GetComponent<PlayableDirector>();
}
public void Open()
{
playableDirector.playableAsset = OpenTimeline;
playableDirector.Play();
}
public void Close()
{
playableDirector.playableAsset = CloseTimeline;
playableDirector.Play();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment