public void AddProcessor(EntityGraph graph)
 {
     if (!processors.ContainsKey(graph))
     {
         processors[graph] = new EntityGraphProcessor(graph);
     }
 }
 public void ProcessRegion(EntityGraph graph, Region region)
 {
     if (processors.ContainsKey(graph))
     {
         processors[graph].ProcessRegion(region);
     }
 }
 public void RemoveProcessor(EntityGraph graph)
 {
     if (processors.ContainsKey(graph))
     {
         processors.Remove(graph);
     }
 }
Example #4
0
        private void OnCreateAsset()
        {
            string filePath = EditorUtility.SaveFilePanelInProject("", "New EntityGraph", "asset", "Create new Entity Graph");

            if (!string.IsNullOrEmpty(filePath))
            {
                EntityGraph newGraph = CreateInstance <EntityGraph>();
                AssetDatabase.CreateAsset(newGraph, filePath);
                InitializeGraph(AssetDatabase.LoadAssetAtPath <EntityGraph>(filePath));
            }
            if (noAsset != null)
            {
                rootView.Remove(noAsset);
            }
        }
Example #5
0
        protected override void AddButtons()
        {
            graph = graphView.graph as EntityGraph;
            AddButton("Preview", () => Preview());
            AddButton("Apply", () => Apply());
            bool visualize = graphView.GetPinnedElementStatus <GizmoSettingsView>() != Status.Hidden;

            AddToggle("Visualization", visualize, (_) => graphView.ToggleView <GizmoSettingsView>());
            projectorCount = new Label($"Projectors in scene: {EntityGraph.ProjectorsInScene.Count}");
            Add(projectorCount);

            EntityGraph.ProjectorsInScene.CollectionChanged += UpdateProjectorCount;

            //bool exposedParamsVisible = graphView.GetPinnedElementStatus<ExposedParameterView>() != Status.Hidden;
            //AddToggle("Show Parameters", exposedParamsVisible, (_) => graphView.ToggleView<ExposedParameterView>(), false);

            AddButton("Center", graphView.ResetPositionAndZoom, false);
            AddButton("Show In Project", () => EditorGUIUtility.PingObject(graphView.graph), false);
        }
 public EntityGraphProcessor(EntityGraph graph) : base(graph)
 {
     this.graph = base.graph as EntityGraph;
 }