Esempio n. 1
0
        void OnInspectorUpdate()
        {
            if (TC_Settings.instance == null)
            {
                GameObject go = new GameObject();
                go.AddComponent <TC_Settings>();

                TC.GetInstallPath();
                GameObject.DestroyImmediate(go);
            }
            else
            {
                TC.GetInstallPath();
            }

            if (TC_Settings.instance == null)
            {
                correctSetup = LoadDefault();
            }
            else if (TC_Settings.instance.global == null)
            {
                correctSetup = LoadDefault();
            }

            if (correctSetup == -1)
            {
                correctSetup = -3;
                window.Close();
            }
            if (!TD.SelectionContainsItemBehaviour())
            {
                Repaint();
            }
        }
Esempio n. 2
0
        void Initialize()
        {
            if (TC_Settings.instance == null)
            {
                GameObject go = new GameObject();
                go.AddComponent <TC_Settings>();

                TC.GetInstallPath();
                GameObject.DestroyImmediate(go);
            }
            else
            {
                TC.GetInstallPath();
            }

            // Debug.Log("Initialize " + TC.installPath);

            if (TC_Settings.instance == null || TC_Settings.instance.global == null)
            {
                correctSetup = LoadDefault();
            }

            if (correctSetup == -1)
            {
                correctSetup = -3;

                closeMe = true;
            }
        }
Esempio n. 3
0
        void Initialize()
        {
            if (TC_Settings.instance == null)
            {
                GameObject go = new GameObject();
                go.AddComponent <TC_Settings>();

                TC.GetInstallPath();
                GameObject.DestroyImmediate(go);
            }
            else
            {
                TC.GetInstallPath();
            }

            // Debug.Log("Initialize " + TC.installPath);
        }
        void OnGUI()
        {
            ShowMessages();

            if (!correctSetup)
            {
                TC.AddMessage("Can't load default project.\nThis file is needed -> TerrainComposer2/Defaults/TerrainComposer2.prefab.\n\n Please try to close and re-open the TerrainComposer window.");
                return;
            }

            if (TC_Settings.instance == null)
            {
                GameObject go = new GameObject();
                go.AddComponent <TC_Settings>();

                TC.GetInstallPath();
                GameObject.DestroyImmediate(go);
            }
            else
            {
                TC.GetInstallPath();
            }

            if (TC_Settings.instance == null)
            {
                if (!LoadDefault())
                {
                    correctSetup = false; return;
                }
            }
            if (TC_Settings.instance.global == null)
            {
                if (!LoadDefault())
                {
                    correctSetup = false; return;
                }
            }

            if (!TD.Init())
            {
                return;
            }

            settings = TC_Settings.instance;
            TC_Reporter.BenchmarkStart();

            TD.countDrawNode = TD.countDrawNodeCulled = 0;

            TD.hoverItem = null;

            TD.rectWindow = new Rect(0, 0, Screen.width, Screen.height);

            settings.selectionOld = Selection.activeTransform;

            if (terrainLayer == null)
            {
                GetLayerLevel();
            }

            Keys();
            ScrollInterface();

            TD.eventCurrent = eventCurrent;

            GUI.DrawTexture(new Rect(0, 0, Screen.width, Screen.height), TD.texShelfBackground1);

            settings.HasMasterTerrain();

            TD.showSelectRect = false;

            CaptureWindowEvents();

            TD.scrollMax = Vector2.zero;

            TC_TerrainLayerGUI.Draw(terrainLayer);
            DrawCommand.DrawCommandLists();

            TC_ItemBehaviourEditor.CheckKeyLockOnSelection(eventCurrent);

            TD.DrawCenter(Color.red, 21, 1);
            TD.DrawCenter(Color.red, 11, 3);

            DrawMenu();

            DropDownMenuMain();

            if (settings.showFps)
            {
                if (!EditorGUIUtility.isProSkin)
                {
                    GUI.color = new Color(1, 1, 1, 0.5f);
                    GUI.DrawTexture(new Rect(180, 0, 250, 17), Texture2D.whiteTexture);
                    GUI.color = Color.white;
                }
                string fps = TC_Reporter.BenchmarkStop("| fps ", false);
                EditorGUI.LabelField(new Rect((Screen.width / 2) - 200, 0, 250, 17), "Node Draw " + TD.countDrawNode + "| Nodes Culled " + TD.countDrawNodeCulled + fps);
            }

            if (onFocus)
            {
                Repaint();
            }
        }