Esempio n. 1
0
 protected static void ShowEditorWindow()
 {
     material = (Material)AssetDatabase.LoadAssetAtPath(materialPath, typeof(Material));
     instance = GetWindow <AnchorEditor>("Anchor Editor", true);
     instance.Show();
     isOpen = true;
 }
Esempio n. 2
0
        public override void OnInspectorGUI()
        {
            DrawDefaultInspector();

            if (script.anchorRoot == null)
            {
                return;
            }

            script.anchorRoot.localPosition = Vector3.zero;
            script.anchorRoot.localRotation = Quaternion.identity;

            if (GUILayout.Button("Anchor Editor"))
            {
                AnchorEditor.ShowEditor(script);
            }

            if (script.anchorRoot.childCount < 2)
            {
                return;
            }

            if (script.curve == null)
            {
                script.CreateCurve();
            }

            if (script.nodeRoot == null || script.nodePrefab == null)
            {
                return;
            }

            GUILayout.BeginHorizontal("Node Editor", "Window", GUILayout.Height(45));
            if (GUILayout.Button("Estimate"))
            {
                EstimateCount();
            }

            if (GUILayout.Button("Create"))
            {
                DeleteNodes();
                script.CreateNodes();
            }

            if (GUILayout.Button("Delete"))
            {
                DeleteNodes();
            }
            GUILayout.EndHorizontal();
        }