Пример #1
0
        protected static GameModeBaseNode GetEdgeNode(GameModeBaseNode[] nodes, string GUID)
        {
            GameModeBaseNode node = null;

            switch (nodes.Length)
            {
            case 0:
                break;

            case 1:
                node = nodes[0];
                break;

            default:
                if (!string.IsNullOrEmpty(GUID))
                {
                    for (int i = 0; i < nodes.Length; i++)
                    {
                        if (nodes[i].GUID == GUID)
                        {
                            node = nodes[i];
                            break;
                        }
                    }
                }
                else
                {
                    var rd = UnityEngine.Random.Range(0, nodes.Length);
                    node = nodes[rd];
                }
                break;
            }

            return(node);
        }
Пример #2
0
 public virtual void MoveTo(int index)
 {
     if (m_processArray.IsValidIndex(index))
     {
         m_current = m_processArray[index];
     }
 }
Пример #3
0
        /// <summary>
        /// Check the previous node and set as current
        /// </summary>
        /// <param name="GUID"></param>
        public virtual void MovePrevious(string GUID = null)
        {
            if (m_current != null)
            {
                var nodes = m_current.PreviousNodes;
                var node  = GetEdgeNode(nodes, GUID);
                if (node != null)
                {
                    m_current = node;
                }
            }

            JobHandle.ScheduleBatchedJobs();
        }