123456789101112131415161718192021222324252627282930313233343536 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using TMPro;
- using KairoEngine.Core;
- using KairoEngine.StorySystem;
- namespace KairoEngine.StorySystem.UI
- {
- public class StoryViewButton : MonoBehaviour
- {
- public TextMeshProUGUI text;
- private string storyName;
- private StoryStepData storyStep;
- private int value;
- private StoryViewUI storyView;
- public void Init(string storyName, StoryStepData storyStep, int n, StoryViewUI storyView)
- {
- this.storyName = storyName;
- this.storyStep = storyStep;
- this.value = n;
- this.storyView = storyView;
- text.text = this.storyStep.branches[this.value];
- }
- public void OnClick()
- {
- //Debug.Log("Button Clicked");
- StoryStepData newStoryStep = new StoryStepData(StoryStepType.Path, storyStep.branches[value], null, null, value);
- storyView.ButtonClicked(newStoryStep);
- EventManager.broadcast.Trigger(storyName, newStoryStep);
- }
- }
- }
|