public UINavGraphView(UINavEditor editor) { this.editor = editor; name = "UI Navigation Graph"; SetupZoom(ContentZoomer.DefaultMinScale, ContentZoomer.DefaultMaxScale); this.AddManipulator(new ContentDragger()); this.AddManipulator(new SelectionDragger()); this.AddManipulator(new RectangleSelector()); this.StretchToParentSize(); //styleSheets.Add(Resources.Load<StyleSheet>("LSMGraphUSS")); GridBackground grid = new GridBackground(); Insert(0, grid); grid.StretchToParentSize(); AddSearchWindow(); new NavNestedEndNode(this, new Vector2(0, 200)); new NavStartNode(this, Vector2.zero); }
public static bool OnOpenAsset(int instanceID, int line) { Object o = EditorUtility.InstanceIDToObject(instanceID); if (o is UINavRepository repository) { string path = AssetDatabase.GetAssetPath(instanceID); UINavEditor dialogEditor = null; UINavEditor[] allWindows = Resources.FindObjectsOfTypeAll <UINavEditor>(); foreach (UINavEditor e in allWindows) { if (e.IsRepository(repository)) { dialogEditor = e; dialogEditor.Show(); break; } } if (dialogEditor == null) { dialogEditor = CreateWindow <UINavEditor>(); } dialogEditor.Open(repository, path); return(true); } return(false); }
internal void Init(UINavGraphView graphView, UINavEditor editor) { this.graphView = graphView; this.editor = editor; indentationIcon = new Texture2D(1, 1); indentationIcon.SetPixel(0, 0, new Color(0, 0, 0, 0)); indentationIcon.Apply(); }
public NavToolbar(UINavEditor parent) { Add(new Button(() => parent.SaveData()) { text = "Save" }); DefaultInputControllerField = new TextField("Default Input Controller"); Add(DefaultInputControllerField); DefaultInAnimationField = new TextField("Default In Animation"); Add(DefaultInAnimationField); DefaultOutAnimationField = new TextField("Default Out Animation"); Add(DefaultOutAnimationField); parent.rootVisualElement.Add(this); }