private void AddOptionsFromCurrentNode() { currentOptions = DialogueShown.CurrentNodeOptions; int indexer = 0; List <GameObject> options = new List <GameObject>(); foreach (DialogueOption option in currentOptions) { GameObject prefabCreated = Instantiate(OptionButtonPrefab, this.transform); OptionButtonScript obs = prefabCreated.GetComponent <OptionButtonScript>(); obs.SetNumber(++indexer); if (option.NextType == NodeType.Condition) { // opisać testy } obs.SetText(option.OptionText); obs.SetOption(option); options.Add(prefabCreated); DialogueLog.Insert(indexer, prefabCreated); } AddSeparator(indexer + 1); }
private void AddContinueButton(int indexer = 0) { int nxt = DialogueShown.CurrentNode.TargetID; NodeType nxtType = DialogueShown.CurrentNode.TargetType; DialogueOption continueOption = new DialogueOption(); continueOption.OptionText = "[Continue]"; continueOption.OptionID = int.MaxValue; continueOption.SetNext(nxt, nxtType); GameObject prefabCreated = Instantiate(OptionButtonPrefab, this.transform); OptionButtonScript obs = prefabCreated.GetComponent <OptionButtonScript>(); obs.SetNumber(++indexer); obs.SetText(continueOption.OptionText); obs.SetOption(continueOption); DialogueLog.Insert(indexer, prefabCreated); AddSeparator(indexer + 1); }