public DialogueActionPanel preset(UnityEvent action, DialogueController controller, Color color, Color textColor, string text) { DialogueActionPanel panel = Instantiate(this, Vector3.zero, Quaternion.identity, controller.transform); panel.gameObject.SetActive(false); controller.Attach(panel); panel.next.onClick.AddListener(delegate { controller.Discard(panel); action.Invoke(); }); panel.cancel.onClick.AddListener(delegate { controller.Cancel(); }); panel.textArea.text = text; panel.textArea.color = textColor; Image[] images = panel.GetComponentsInChildren <Image>(true); foreach (Image i in images) { i.material.color = color; } return(panel); }
public abstract DialoguePanel createSubtree(DialogueController controller, Color color, Color textColor, DialogueNextPanel dnp, DialogueSplitPanel dsp, DialogueActionPanel dap);
public override DialoguePanel createSubtree(DialogueController controller, Color color, Color textColor, DialogueNextPanel dnp, DialogueSplitPanel dsp, DialogueActionPanel dap) { DialoguePanel panel = nextNode.createSubtree(controller, color, textColor, dnp, dsp, dap); return(dnp.preset(panel, controller, color, textColor, text)); }
public override DialoguePanel createSubtree(DialogueController controller, Color color, Color textColor, DialogueNextPanel dnp, DialogueSplitPanel dsp, DialogueActionPanel dap) { DialoguePanel optionAPanel = optionA.createSubtree(controller, color, textColor, dnp, dsp, dap); DialoguePanel optionBPanel = optionB.createSubtree(controller, color, textColor, dnp, dsp, dap); return(dsp.preset(optionAPanel, optionBPanel, controller, color, textColor, text, optionAText, optionBText)); }
public override DialoguePanel createSubtree(DialogueController controller, Color color, Color textColor, DialogueNextPanel dnp, DialogueSplitPanel dsp, DialogueActionPanel dap) { return(dap.preset(action, controller, color, textColor, text)); }