Exemplo n.º 1
0
        public ComponentQueriesRow(IReadOnlyCollection <ComponentQueryDeclarationModel> componentQueryDeclarationModels,
                                   Blackboard blackboard,
                                   Stencil stencil,
                                   Blackboard.RebuildCallback rebuildCallback)
        {
            AddToClassList("componentQueriesRow");

            styleSheets.Add(AssetDatabase.LoadAssetAtPath <StyleSheet>(UICreationHelper.TemplatePath + "BlackboardECS.uss"));
            // @TODO: This might need to be reviewed in favor of a better / more scalable approach (non preprocessor based)
            // that would ideally bring the same level of backward/forward compatibility and/or removed when a 2013 beta version lands.
#if UNITY_2019_3_OR_NEWER
            styleSheets.Add(AssetDatabase.LoadAssetAtPath <StyleSheet>(UICreationHelper.TemplatePath + "BlackboardECS.2019.3.uss"));
#endif

            IReadOnlyCollection <ComponentQueryDeclarationModel> activeQueryDeclarationModels = componentQueryDeclarationModels;

            State state = blackboard.Store.GetState();

            var componentsSubSection = new ComponentsSubSection(stencil, activeQueryDeclarationModels, blackboard);
            Add(componentsSubSection);
            if (state.EditorDataModel.ShouldExpandBlackboardRowUponCreation($"{BlackboardEcsProviderTypeName}/{componentsSubSection.GetType().Name}"))
            {
                componentsSubSection.Expanded = true;
            }

            var criteriaSubSection = new CriteriaSubSection(stencil, activeQueryDeclarationModels, blackboard);
            Add(criteriaSubSection);
            if (state.EditorDataModel.ShouldExpandBlackboardRowUponCreation($"{BlackboardEcsProviderTypeName}/{criteriaSubSection.GetType().Name}"))
            {
                criteriaSubSection.Expanded = true;
            }

            userData = "ComponentQueriesRow";
        }
Exemplo n.º 2
0
 static VisualElement CreateExtendedFieldView(Store store,
                                              IVariableDeclarationModel variableDeclarationModel,
                                              Stencil stencil,
                                              Blackboard.RebuildCallback rebuild)
 {
     return(new BlackboardVariablePropertyView(store, variableDeclarationModel, rebuild, stencil)
            .WithTypeSelector()
            .WithTooltipField()
            .WithInitializationField());
 }
Exemplo n.º 3
0
        public ComponentQuery(ComponentQueryDeclarationModel componentQueryDeclarationModel,
                              Store store,
                              Blackboard.RebuildCallback rebuildCallback)
            : base(componentQueryDeclarationModel, store, rebuildCallback)
        {
            name = "componentQuery";

            capabilities |= Capabilities.Selectable | Capabilities.Droppable | Capabilities.Deletable;

            RegisterCallback <MouseDownEvent>(OnMouseDownEvent);

            this.AddManipulator(new SelectionDropper());
        }
Exemplo n.º 4
0
        public ComponentQueriesRow(IReadOnlyCollection <ComponentQueryDeclarationModel> componentQueryDeclarationModels,
                                   Blackboard blackboard,
                                   Stencil stencil,
                                   Blackboard.RebuildCallback rebuildCallback)
        {
            AddToClassList("componentQueriesRow");

            styleSheets.Add(AssetDatabase.LoadAssetAtPath <StyleSheet>(UICreationHelper.TemplatePath + "BlackboardECS.uss"));
            // @TODO: This might need to be reviewed in favor of a better / more scalable approach (non preprocessor based)
            // that would ideally bring the same level of backward/forward compatibility and/or removed when a 2013 beta version lands.
#if UNITY_2019_3_OR_NEWER
            styleSheets.Add(AssetDatabase.LoadAssetAtPath <StyleSheet>(UICreationHelper.TemplatePath + "BlackboardECS.2019.3.uss"));
#endif

            IReadOnlyCollection <ComponentQueryDeclarationModel> activeQueryDeclarationModels = componentQueryDeclarationModels;

            foreach (var queryDeclarationModel in activeQueryDeclarationModels)
            {
                var componentQuery = new QuerySubSection(stencil, queryDeclarationModel, blackboard);
                Add(componentQuery);
            }

            userData = "ComponentQueriesRow";
        }
Exemplo n.º 5
0
 public DotsVariablePropertyView(Store store, IVariableDeclarationModel variableDeclarationModel, Blackboard.RebuildCallback rebuildCallback, Stencil stencil)
     : base(store, variableDeclarationModel, rebuildCallback, stencil)
 {
 }