Пример #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;
        }
Пример #2
0
        public void BindDataAdapter(BaseDataAdapter adapter, Object data)
        {
            if (null != Data)
            {
                Data.CleanUp();
            }
            Data = adapter;


            Data.LoadData(data);

            InitDataInView();
        }