|
@@ -17,6 +17,7 @@ namespace KairoEngine.StorySystem.UI
|
|
|
public Transform panel;
|
|
|
|
|
|
[BoxGroup("Story Lines")]public bool showLines = false;
|
|
|
+ [BoxGroup("Story Lines")] public bool skipEmptyLines = true;
|
|
|
[BoxGroup("Story Lines"), ShowIf("@showLines")] public bool showMultipleLines = true;
|
|
|
[BoxGroup("Story Lines"), ShowIf("@showLines && showMultipleLines")] public bool destroyLinesAfterPath = true;
|
|
|
[BoxGroup("Story Lines"), ShowIf("@showLines && showMultipleLines")] public GameObject storyLinePrefab;
|
|
@@ -59,13 +60,15 @@ namespace KairoEngine.StorySystem.UI
|
|
|
if(buttons != null)
|
|
|
{
|
|
|
for (int i = 0; i < buttons.Count; i++) Destroy(buttons[i]);
|
|
|
+ buttons.Clear();
|
|
|
}
|
|
|
- buttons.Clear();
|
|
|
- GameObject[] oldButtons = branchContainer.GetComponentsInChildren<GameObject>();
|
|
|
- if(oldButtons != null)
|
|
|
- {
|
|
|
- for (int i = 0; i < oldButtons.Length; i++) Destroy(oldButtons[i]);
|
|
|
- }
|
|
|
+ else buttons = new List<GameObject>();
|
|
|
+ //GameObject[] oldButtons = null;
|
|
|
+ //if(branchContainer != null) oldButtons = branchContainer.gameObject.GetComponentsInChildren<GameObject>();
|
|
|
+ // if(oldButtons != null)
|
|
|
+ // {
|
|
|
+ // for (int i = 0; i < oldButtons.Length; i++) Destroy(oldButtons[i]);
|
|
|
+ // }
|
|
|
for (int i = 0; i < prePopulateButtons; i++)
|
|
|
{
|
|
|
GameObject obj = Instantiate(storyBranchPrefab, branchContainer);
|
|
@@ -89,6 +92,10 @@ namespace KairoEngine.StorySystem.UI
|
|
|
|
|
|
private void OnStoryStep(StoryStepData storyStep)
|
|
|
{
|
|
|
+ if(skipEmptyLines)
|
|
|
+ {
|
|
|
+ if(storyStep.text == "" && storyStep.branches == null) return;
|
|
|
+ }
|
|
|
switch (storyStep.category)
|
|
|
{
|
|
|
case StoryStepType.Line:
|