Beispiel #1
0
        public void Init()
        {
            //初始化入口节点
            GraphInfo graphInfo         = GraphInfo.GetRootAsGraphInfo(byteBuffer);
            int       entranceNodeCount = graphInfo.EntranceNodeIdsLength;

            for (int i = 0; i < entranceNodeCount; i++)
            {
                int nodeId = graphInfo.EntranceNodeIds(i);
                EntranceNodeBase entranceNode = DeserializeNode(nodeId) as EntranceNodeBase;
                if (entranceNode == null)
                {
                    Debug.LogError(string.Format("节点 {0} 不是入口节点", nodeId));
                    continue;
                }

                if (onClickNode == null)
                {
                    onClickNode = entranceNode as OnClickNode;
                }

                if (onJoyStickDragNode == null)
                {
                    onJoyStickDragNode = entranceNode as OnJoyStickDragNode;
                }

                if (onJoyStickDownNode == null)
                {
                    onJoyStickDownNode = entranceNode as OnJoyStickDownNode;
                }

                if (onJoyStickUpNode == null)
                {
                    onJoyStickUpNode = entranceNode as OnJoyStickUpNode;
                }
            }
        }