コード例 #1
0
        public static List <BlockMenuAttribute> GetActionMenus(bool acceptCoroutine = false)
        {
            if (_actionMenus != null)
            {
                return(_actionMenus);
            }
            _actionMenus = new List <BlockMenuAttribute>();
            var menus = EventDataDrawer.FindAllMenu();

            for (int i = 0; i < menus.Count; i++)
            {
                if (!acceptCoroutine && menus[i].isCoroutine || menus[i].hideOnBlock)
                {
                    continue;
                }
                if (menus[i].type.IsCastableTo(typeof(Events.Action)) ||
                    menus[i].type.IsCastableTo(typeof(AnyBlock)) ||
                    menus[i].type.IsCastableTo(typeof(IFlowNode)) ||
                    menus[i].type.IsCastableTo(typeof(IStateNode)) ||
                    menus[i].type.IsCastableTo(typeof(ICoroutineNode)) ||
                    menus[i].type.IsCastableTo(typeof(IStateCoroutineNode)))
                {
                    _actionMenus.Add(menus[i]);
                }
            }
            return(_actionMenus);
        }
コード例 #2
0
        public static List <BlockMenuAttribute> GetConditionMenus()
        {
            if (_conditionMenus != null)
            {
                return(_conditionMenus);
            }
            _conditionMenus = new List <BlockMenuAttribute>();
            var menus = EventDataDrawer.FindAllMenu();

            for (int i = 0; i < menus.Count; i++)
            {
                if (menus[i].hideOnBlock)
                {
                    continue;
                }
                if (menus[i].type.IsCastableTo(typeof(Condition)) ||
                    menus[i].type.IsCastableTo(typeof(IDataNode <bool>)))
                {
                    _conditionMenus.Add(menus[i]);
                }
            }
            return(_conditionMenus);
        }