コード例 #1
0
        private void ClickNode(SkillHsmConfigNodeData nodeValue)
        {
            if (null == nodeValue)
            {
                return;
            }
            int nodeId = (null != nodeValue) ? nodeValue.Id : -1;

            if (HSMManager.hSMChangeSelectId != null)
            {
                HSMManager.hSMChangeSelectId(nodeId);
            }

            if (nodeValue.NodeType == (int)NODE_TYPE.SUB_STATE_MACHINE)
            {
                int currentTime = (int)(Time.realtimeSinceStartup * 1000);
                if (currentTime - lastClickNodeTime <= 200)
                {
                    if (null != HSMManager.hsmOpenSubMachine)
                    {
                        HSMManager.hsmOpenSubMachine(nodeId);
                    }
                }
                lastClickNodeTime = (int)(Time.realtimeSinceStartup * 1000);
            }
        }
コード例 #2
0
        private void DrawTitle()
        {
            int        selectIndex = 0;
            List <int> idList      = new List <int>();

            string[] optionArr = _drawModel.GetOptionArr(ref selectIndex, ref idList);
            int      option    = selectIndex;

            option = GUILayout.Toolbar(option, optionArr, EditorStyles.toolbarButton, GUILayout.Width(optionArr.Length * 200));
            if (option != selectIndex)
            {
                if (null != HSMManager.hsmOpenSubMachine)
                {
                    int nodeId = idList[option];
                    HSMManager.hsmOpenSubMachine(nodeId);
                }
            }
        }