Skip to content

Instantly share code, notes, and snippets.

@nabesi777
Created November 26, 2018 10:52
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 nabesi777/1c7df4c580c5e6205fa1a1f51a745809 to your computer and use it in GitHub Desktop.
Save nabesi777/1c7df4c580c5e6205fa1a1f51a745809 to your computer and use it in GitHub Desktop.
FadeInPlayableAsset
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Playables;
using UnityEngine.UI;
[System.Serializable]
public class FadeInPlayableAsset : PlayableAsset
{
//UIテキストを格納
[SerializeField] private ExposedReference<GameObject> text;
//fadeのスピード
[SerializeField] private float fadeSpeed = 0.02f;
private Color textColor;
// Factory method that generates a playable based on this asset
public override Playable CreatePlayable(PlayableGraph graph, GameObject go) {
var behaviour = new FadeInPlayableBehaviour
{
text = text.Resolve(graph.GetResolver()),
textColor = textColor
};
return ScriptPlayable<FadeInPlayableBehaviour>.Create(graph, behaviour);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment