Created
November 26, 2018 10:52
-
-
Save nabesi777/1c7df4c580c5e6205fa1a1f51a745809 to your computer and use it in GitHub Desktop.
FadeInPlayableAsset
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; | |
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