PlayableAssetInteractiveSelection.cs 859 B

12345678910111213141516171819202122
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.Playables;
  5. using UnityEngine.UI;
  6. [System.Serializable]
  7. public class PlayableAssetInteractiveSelection : PlayableAsset
  8. {
  9. public ExposedReference<Text> selectionText;
  10. public string textStr;
  11. public int nextInteractiveSelectionId;
  12. // Factory method that generates a playable based on this asset
  13. public override Playable CreatePlayable(PlayableGraph graph, GameObject go)
  14. {
  15. PlayableBehaviourInteractiveSelection selectionPlayable = new PlayableBehaviourInteractiveSelection();
  16. selectionPlayable.Init(selectionText.Resolve(graph.GetResolver()), textStr, nextInteractiveSelectionId);
  17. return ScriptPlayable<PlayableBehaviourInteractiveSelection>.Create(graph, selectionPlayable, nextInteractiveSelectionId);
  18. }
  19. }