Beispiel #1
0
        private void ReleaseDebugTextures()
        {
            foreach (KeyValuePair <int, RenderTexture> p in debugMap)
            {
                p.Value.Release();
                TerrainAlignEditor.DestroyImmediate(p.Value);
            }

            debugMap.Clear();
        }
        public void OnEnable()
        {
            this.editor       = this;
            this.editorTarget = (TerrainAlign)this.target;

            // get the sceneview window. don't focus it, there's an occasional bug where it would get recreated and then you have multiple ones
            sceneView = EditorWindow.GetWindow <SceneView>("Scene View Window", false);

            // try getting a terrain in case there is none
            if (!editorTarget.settings.terrain)
            {
                editorTarget.settings.terrain = UnityEngine.Object.FindObjectOfType <Terrain>();
            }

            meshProjector = new MeshProjector(editorTarget.settings, editorTarget.gameObject);
            meshProjector.OnEnable();
        }