|
@@ -56,6 +56,16 @@ namespace KairoEngine.StorySystem.UI
|
|
|
|
|
|
void Start()
|
|
|
{
|
|
|
+ if(buttons != null)
|
|
|
+ {
|
|
|
+ for (int i = 0; i < buttons.Count; i++) Destroy(buttons[i]);
|
|
|
+ }
|
|
|
+ buttons.Clear();
|
|
|
+ GameObject[] oldButtons = branchContainer.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);
|
|
@@ -115,7 +125,7 @@ namespace KairoEngine.StorySystem.UI
|
|
|
{
|
|
|
if(buttons != null)
|
|
|
{
|
|
|
- for (int i = storyStep.branches.Count; i < buttons.Count; i++)
|
|
|
+ for (int i = 0; i < buttons.Count; i++)
|
|
|
{
|
|
|
//Destroy(buttons[i]);
|
|
|
buttons[i].SetActive(false);
|