PlayableAssetInteractiveBubble.cs 837 B

123456789101112131415161718192021
  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 PlayableAssetInteractiveBubble : PlayableAsset
  8. {
  9. public ExposedReference<Transform> bubblePoint;
  10. public ExposedReference<Text> talkText;
  11. public string talkStr;
  12. // Factory method that generates a playable based on this asset
  13. public override Playable CreatePlayable(PlayableGraph graph, GameObject go)
  14. {
  15. PlayableBehaviourInteractiveBubble interactivePlayable = new PlayableBehaviourInteractiveBubble();
  16. interactivePlayable.Init(talkText.Resolve(graph.GetResolver()), bubblePoint.Resolve(graph.GetResolver()), talkStr);
  17. return ScriptPlayable<PlayableBehaviourInteractiveBubble>.Create(graph, interactivePlayable);
  18. }
  19. }