Esempio n. 1
0
        void OnLoadClick()
        {
            tiledMapDataModifier = new TiledMapDataModifier();

            Type adapterType = Type.GetType(AdapterNames[mModifyType]);

            BaseDataAdapter adapter = Activator.CreateInstance(adapterType) as BaseDataAdapter;

            if (null == data)
            {
                data = adapter.CreateDefaultData();
            }

            tiledMapDataModifier.BindDataAdapter(adapter, data);

            BrushTypeNames = tiledMapDataModifier.Data.GetEnumNames();


            var     sv     = SceneView.lastActiveSceneView;
            var     range  = tiledMapDataModifier.Data.Range;
            Vector3 center = new Vector3(range.x / 2, 0, range.y / 2);

            sv.in2DMode = false;
            sv.LookAt(center, new Quaternion(1, 0, 0, 1), 200, true, false);
            sv.Repaint();


            mIsEditing = true;

            SceneView.onSceneGUIDelegate -= this.OnSceneGUI;
            SceneView.onSceneGUIDelegate += this.OnSceneGUI;
        }
Esempio n. 2
0
        private void CleanUp()
        {
            if (null != tiledMapDataModifier)
            {
                tiledMapDataModifier.CleanUp();
                tiledMapDataModifier = null;
            }

            if (null != goRoot)
            {
                DestroyImmediate(goRoot);
                goRoot = null;
            }
        }