/// <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
            {
                //寻找有没有默认节点
            }
        }
Beispiel #2
0
        public override void Trigger(IPlayerForNode player)
        {
            var output = GetOutputPort("Do");

            if (output.ConnectionCount >= 1)
            {
                var next = output.GetConnection(0).node as DialogueBaseNode;
                next.Trigger(player);
            }
        }
Beispiel #3
0
        public override void Enter(IPlayerForNode player)
        {
            var output = GetOutputPort(DialogueDefine.NODE_START_OUT);

            if (output.ConnectionCount >= 1)
            {
                var next = output.GetConnection(0).node as DialogueBaseNode;
                next.Enter(player);
            }
            else
            {
                Debug.Log("#Drama Start Node No Connect");;
            }
        }
        public override void DoNext(IPlayerForNode player)
        {
            var output = GetOutputPort("output");

            if (output.ConnectionCount >= 1)
            {
                var next = output.GetConnection(0).node as DialogueBaseNode;
                next.Trigger(player);
            }
            else
            {
                //意外结束
                player.DoFinish("");
            }
        }
Beispiel #5
0
        public override void DoNext(IPlayerForNode player)
        {
            var output = GetOutputPort(DialogueDefine.NODE_CONTENT_OUTPUT);

            if (output.ConnectionCount >= 1)
            {
                var next = output.GetConnection(0).node as DialogueBaseNode;
                next.Enter(player);
            }
            else
            {
                Debug.LogError("#Drama Content Node No Connect");
                //意外结束
                //player.DoFinish("");
            }
        }
Beispiel #6
0
        public void StartDialogue(IPlayerForNode player)
        {
            foreach (var item in nodes)
            {
                if (item.name == DialogueDefine.NODE_START && m_StartNode == null)
                {
                    m_StartNode = (DialogueStart)item;
                }
            }


            if (m_StartNode != null)
            {
                m_StartNode.Enter(player);
                return;
            }
        }
Beispiel #7
0
        public override void DoNextWhitParam(IPlayerForNode player, System.Object param)
        {
            var select_info = (string)param;

            //Debug.Log("走到这里了,附带参数:" + select_info);
            if (!select_info.IsNullOrEmpty())
            {
                int index = -1;
                //Debug.Log("总数  " + ChooseList.Count);
                for (int i = 0; i < ChooseList.Count; i++)
                {
                    if (ChooseList[i].Content == select_info)
                    {
                        index = i;
                        //是否是单次选择节点
                        if (ChooseList[i].Once)
                        {
                            //记录它
                            mOnceSelectList.Add(ChooseList[i].Content);
                        }
                        break;
                    }
                }
                if (index == -1)
                {
                    player.DoFinish("");
                    return;
                }

                var port = GetOutputPort("ChooseList " + index);
                if (port == null)
                {
                    player.DoFinish("");
                    return;
                }

                if (port.ConnectionCount >= 1)
                {
                    var next = port.GetConnection(0).node as DialogueBaseNode;
                    next.Trigger(player);
                }
            }
        }
        public override void Trigger(IPlayerForNode player)
        {
            var _knotName = GetInputValue <string>("KnotName", this.KnotName);

            if (!_knotName.IsNullOrEmpty())
            {
                var bp   = graph as DialogueBluePrint;
                var knot = bp.GetKnot(_knotName);
                if (knot == null)
                {
                    Debug.Log("没找到节点:" + _knotName);
                    player.DoFinish("");
                }
                else
                {
                    knot.Trigger(player);
                }
            }
        }
Beispiel #9
0
        public override void DoNextWhitParam(IPlayerForNode player, params object[] args)
        {
            if (args == null || args.Length <= 0)
            {
                return;
            }

            Choose choose = (Choose)(args[0]);
            int    index  = -1;

            for (int i = 0; i < Chooses.Count; i++)
            {
                if (Chooses[i] == choose)
                {
                    index = i;
                    break;
                }
            }

            if (index != -1)
            {
                var port = GetOutputPort("Chooses " + index);
                if (port.ConnectionCount > 0)
                {
                    var next = port.GetConnection(0).node as DialogueBaseNode;
                    next.Enter(player);
                }
                else
                {
                    Debug.LogError("[Drama][Choose Item Node No Connect]");
                }
            }
            else
            {
                Debug.LogError("[Drama][Choose Item No Choose]");
            }
        }
Beispiel #10
0
 public override void Exit(IPlayerForNode player)
 {
 }
Beispiel #11
0
 public override void Enter(IPlayerForNode player)
 {
     player.DoChoose(this);
 }
Beispiel #12
0
 abstract public void DoNextWhitParam(IPlayerForNode player, System.Object param);
Beispiel #13
0
 public override void DoNextWhitParam(IPlayerForNode player, params object[] args)
 {
 }
Beispiel #14
0
 public override void Enter(IPlayerForNode player)
 {
     player.DoFinish(this);
 }
Beispiel #15
0
 abstract public void Trigger(IPlayerForNode player);
 public override void Trigger(IPlayerForNode player)
 {
     player.DoContent(this);
 }
Beispiel #17
0
 abstract public void DoNext(IPlayerForNode player);
Beispiel #18
0
 abstract public void Exit(IPlayerForNode player);
Beispiel #19
0
 public override void Trigger(IPlayerForNode player)
 {
 }
 public override void DoNextWhitParam(IPlayerForNode player, object param)
 {
 }
Beispiel #21
0
 public override void DoNext(IPlayerForNode player)
 {
     //throw new System.NotImplementedException();
 }
Beispiel #22
0
 public override void Trigger(IPlayerForNode player)
 {
     player.DoFinish(Message);
 }
Beispiel #23
0
 abstract public void DoNextWhitParam(IPlayerForNode player, params object[] args);
 public override void DoNext(IPlayerForNode player)
 {
 }
 public override void DoNextWhitParam(IPlayerForNode player, System.Object param)
 {
     //throw new System.NotImplementedException();
 }
Beispiel #26
0
 abstract public void Enter(IPlayerForNode player);
Beispiel #27
0
 public override void Enter(IPlayerForNode player)
 {
 }