/// <summary> /// 开始Node流程 /// </summary> public void StartNode(IPlayerForNode player) { mPlayer = player; foreach (var item in nodes) { //Debug.Log("node:" + item.name); if (item.name == "Start" && mStartNode == null) { mStartNode = (DialogueStart)item; } if (item.name == "Knot") { var knot = (DialogueKnot)item; if (!knot.KnotName.IsNullOrEmpty()) { if (!mKnots.ContainsKey(knot.KnotName)) { mKnots.Add(knot.KnotName, knot); } } } } //如果有Start if (mStartNode != null) { mStartNode.Trigger(mPlayer); } else { //寻找有没有默认节点 } }
/// <summary> /// 重新初始化所有蓝图节点,和自身 /// </summary> public void ReInit() { mStartNode = null; mKnots = new Dictionary <string, DialogueKnot>(); foreach (var item in nodes) { var bpNode = (DialogueBaseNode)item; bpNode.ReInit(); } }