Beispiel #1
0
        // Use this for initialization
        public void Init()
        {
            int width  = LevelEditorInfo.Instance.BoardWidth;
            int height = LevelEditorInfo.Instance.BoardHeight;

            switch (boardType)
            {
            case BoardType.Hex:
                _coord = new CoordinationHex(width, height);
                break;

            default:
                break;
            }


            _board = new EditorBoard(width, height, LevelListScrollerController.instance.CurrentLevel);
            _board.onDataChanged += RefreshSingleCell;



            InitCellViews(_board);
            InitBoardCellColliders();


            _comList          = new UndoRedoList();
            _comList.OnClean += _comList_OnClean;
            _comList.OnDirty += _comList_OnDirty;
        }
        void Start()
        {
            LoadLevelList();

            _comList          = new UndoRedoList();
            _comList.OnClean += OnListClean;
            _comList.OnDirty += OnListDirty;



            myScroller.Delegate      = this;
            _levelList.onDataChange += () => {
                myScroller.ReloadData();
                _scrollRect.onValueChanged.Invoke(_scrollRect.normalizedPosition);
            };
        }