コード例 #1
0
ファイル: LibraryGUI.cs プロジェクト: BeauPrime/RuleScript
        /// <summary>
        /// A action selector for a specific entity.
        /// </summary>
        static public int ActionSelector(Rect inPosition, GUIContent inLabel, int inCurrentId, IRSEntity inEntity, RSLibrary inLibrary)
        {
            RSEditorUtility.s_ActionElements.Clear();
            inLibrary.GetAllActionsForEntity(inEntity, RSEditorUtility.s_ActionElements);

            return(RSGUI.RSElementSelector(inPosition, inLabel, inCurrentId, RSEditorUtility.s_ActionElements));
        }
コード例 #2
0
ファイル: LibraryGUI.cs プロジェクト: BeauPrime/RuleScript
        /// <summary>
        /// A action selector for a unknown entity.
        /// </summary>
        static public int ActionSelectorUnknown(Rect inPosition, int inCurrentId, RSLibrary inLibrary)
        {
            RSEditorUtility.s_ActionElements.Clear();
            inLibrary.GetAllLocalActions(RSEditorUtility.s_ActionElements);

            return(RSGUI.RSElementSelector(inPosition, inCurrentId, RSEditorUtility.s_ActionElements));
        }
コード例 #3
0
ファイル: LibraryGUI.cs プロジェクト: BeauPrime/RuleScript
        /// <summary>
        /// A query selector for a specific entity.
        /// </summary>
        static public int QuerySelector(Rect inPosition, GUIContent inLabel, int inCurrentId, IRSEntity inEntity, RSTypeInfo inReturnType, bool inbNoParams, RSLibrary inLibrary)
        {
            RSEditorUtility.s_QueryElements.Clear();
            inLibrary.GetAllQueriesForEntity(inEntity, RSEditorUtility.s_QueryElements, inReturnType, inbNoParams);

            return(RSGUI.RSElementSelector(inPosition, inLabel, inCurrentId, RSEditorUtility.s_QueryElements));
        }
コード例 #4
0
ファイル: LibraryGUI.cs プロジェクト: BeauPrime/RuleScript
        /// <summary>
        /// A query selector for a unknown entity.
        /// </summary>
        static public int QuerySelectorUnknown(Rect inPosition, GUIContent inLabel, int inCurrentId, bool inbNoParams, RSLibrary inLibrary)
        {
            RSEditorUtility.s_QueryElements.Clear();
            inLibrary.GetAllLocalQueries(RSEditorUtility.s_QueryElements, null, inbNoParams);

            return(RSGUI.RSElementSelector(inPosition, inLabel, inCurrentId, RSEditorUtility.s_QueryElements));
        }
コード例 #5
0
ファイル: LibraryGUI.cs プロジェクト: BeauPrime/RuleScript
        /// <summary>
        /// A query selector for the global scope.
        /// </summary>
        static public int QuerySelectorGlobal(Rect inPosition, int inCurrentId, RSTypeInfo inReturnType, bool inbNoParams, RSLibrary inLibrary)
        {
            RSEditorUtility.s_QueryElements.Clear();
            inLibrary.GetAllGlobalQueries(RSEditorUtility.s_QueryElements, inReturnType, inbNoParams);

            return(RSGUI.RSElementSelector(inPosition, inCurrentId, RSEditorUtility.s_QueryElements));
        }
コード例 #6
0
ファイル: LibraryGUI.cs プロジェクト: BeauPrime/RuleScript
        /// <summary>
        /// A trigger selector for a specific entity.
        /// </summary>
        static public RSTriggerId TriggerSelector(Rect inPosition, GUIContent inLabel, RSTriggerId inCurrentId, RSTypeInfo inParameterType, RSLibrary inLibrary)
        {
            RSEditorUtility.s_TriggerElements.Clear();
            inLibrary.GetAllTriggers(RSEditorUtility.s_TriggerElements, inParameterType ?? RSBuiltInTypes.Void);

            int trigger = RSGUI.RSElementSelector(inPosition, inLabel, (int)inCurrentId, RSEditorUtility.s_TriggerElements);

            return(new RSTriggerId(trigger));
        }
コード例 #7
0
ファイル: LibraryGUI.cs プロジェクト: BeauPrime/RuleScript
        /// <summary>
        /// A group selector.
        /// </summary>
        static public RSGroupId GroupSelector(Rect inPosition, GUIContent inLabel, RSGroupId inCurrentGroup, RSLibrary inLibrary)
        {
            RSEditorUtility.s_GroupElements.Clear();
            inLibrary.GetAllGroups(RSEditorUtility.s_GroupElements);

            int group = RSGUI.RSElementSelector(inPosition, inLabel, (int)inCurrentGroup, RSEditorUtility.s_GroupElements);

            return(new RSGroupId(group));
        }
コード例 #8
0
ファイル: LibraryGUI.cs プロジェクト: BeauPrime/RuleScript
        /// <summary>
        /// A trigger selector.
        /// </summary>
        static public RSTriggerId TriggerSelector(Rect inPosition, RSTriggerId inCurrentId, RSLibrary inLibrary)
        {
            RSEditorUtility.s_TriggerElements.Clear();
            inLibrary.GetAllTriggers(RSEditorUtility.s_TriggerElements);

            int trigger = RSGUI.RSElementSelector(inPosition, (int)inCurrentId, RSEditorUtility.s_TriggerElements);

            return(new RSTriggerId(trigger));
        }
コード例 #9
0
ファイル: LibraryGUI.cs プロジェクト: BeauPrime/RuleScript
        /// <summary>
        /// A trigger selector for a specific entity.
        /// </summary>
        static public RSTriggerId TriggerSelector(Rect inPosition, GUIContent inLabel, RSTriggerId inCurrentId, IRSEntity inEntity, RSLibrary inLibrary)
        {
            RSEditorUtility.s_TriggerElements.Clear();
            inLibrary.GetAllTriggersForEntity(inEntity, RSEditorUtility.s_TriggerElements);
            inLibrary.GetAllGlobalTriggers(RSEditorUtility.s_TriggerElements);

            int trigger = RSGUI.RSElementSelector(inPosition, inLabel, (int)inCurrentId, RSEditorUtility.s_TriggerElements);

            return(new RSTriggerId(trigger));
        }
コード例 #10
0
ファイル: RSGUILayout.cs プロジェクト: BeauPrime/RuleScript
        static internal int RSElementSelectorImpl <T>(GUIContent inLabel, int inCurrentId, RSElementList <T> inElementList, params GUILayoutOption[] inOptions) where T : IRSInfo
        {
            inElementList.RefreshInspectorList();

            int currentIdx = inElementList.IndexOf(inCurrentId);
            int nextIdx    = EditorGUILayout.Popup(inLabel, currentIdx, inElementList.InspectorList(), inOptions);

            if (nextIdx < 0)
            {
                GUILayout.Label(RSGUI.NullHelpTooltip(typeof(T)), RSGUIStyles.HelpTooltipStyle, RSGUI.HelpTooltipLayoutOptions());
                return(inCurrentId);
            }

            var element = inElementList.ElementAt(nextIdx);

            if (element == null)
            {
                GUILayout.Label(RSGUI.NullHelpTooltip(typeof(T)), RSGUIStyles.HelpTooltipStyle, RSGUI.HelpTooltipLayoutOptions());
                return(0);
            }

            GUILayout.Label(RSGUI.HelpTooltip(element.Tooltip), RSGUIStyles.HelpTooltipStyle, RSGUI.HelpTooltipLayoutOptions());
            return(element.IdHash);
        }