public override void ViewNext(IList <Branch> branches) { var validBranches = from branch in branches where branch.IsValid select branch; _currentData = new BranchData(); AboutToRequestMain = false; if (validBranches.Count() <= 1 || ArticyManager.Instance.CharacterHub) { return; } AboutToRequestMain = true; Debug.Log("BranchesManager about to request main."); //We create buttons for all posible options foreach (var branch in validBranches) { var menuObject = branch.Target as IObjectWithText; var text = menuObject?.Text ?? ""; _currentData.AddButton(new BranchButtonData { text = text, callback = () => EndDecision(branch) }); } //Create the text and show image if (_flowPlayer.CurrentObject.HasReference) { var node = _flowPlayer.CurrentObject.GetObject(); if (node is IObjectWithText textObject) { _currentData.description = textObject.Text; } if (node is DialogueFragment dialog) { if (dialog.Speaker is IObjectWithPreviewImage previewImage) { var asset = previewImage.PreviewImage.Asset; if (asset != null) { _currentData.portrait = asset.LoadAssetAsSprite(); return; } } } } }