//
        public void undoLastActions()
        {
            EditorObjectSelection.Instance.ClearSelection(false);

            _curVoxelsLevelChunk.undo();

            //int effectedCubes = 0;
            //Shader shader = Shader.Find (Globals.defaultShaderName);
            //Renderer renderer;

            undoAction undo;
            undoItem   item;

            int i, len = _undoActions.Count;

            for (i = 0; i < len; ++i)
            {
                undo = _undoActions [i];

                // DIG

                /*
                 * if (undo.action == AppState.Dig) {
                 *      if (undo.go != null) {
                 *              undo.go.SetActive (true);
                 *              effectedCubes++;
                 *      }
                 * }
                 * // BUILD
                 * else if (undo.action == AppState.Build) {
                 *      if (undo.go != null) {
                 *              //Destroy (undo.go);
                 *              undo.go.SetActive (false);
                 *              effectedCubes--;
                 *      }
                 * }
                 * // PAINT
                 * else if (undo.action == AppState.Paint) {
                 *      if (undo.go != null) {
                 *              undo.material.shader = shader;
                 *              renderer = undo.go.GetComponent<Renderer> ();
                 *              if (renderer != null) {
                 *                      renderer.sharedMaterial = undo.material;
                 *              }
                 *      }
                 * }
                 * // PROP
                 * else*/
                if (undo.action == AppState.Props)
                {
                    if (undo.go != null)
                    {
                        _curVoxelsLevelChunk.removeWorldProp(undo.go);
                        Destroy(undo.go);
                    }
                }

                undo.go       = null;
                undo.parent   = null;
                undo.material = null;

                // items
                int j, len2 = undo.items.Count;
                for (j = 0; j < len2; ++j)
                {
                    item = undo.items[j];
                    if (item.go != null)
                    {
                        item.go.transform.position = item.position;
                        item.go.transform.rotation = item.rotation;
                    }
                    item.go = null;
                }
                undo.items.Clear();

                _undoActions [i] = undo;
            }

            _undoActions.Clear();
            MainMenu.Instance.setUndoButton(false);

            /*
             * if (effectedCubes != 0) {
             *      _curLevelChunk.numCubes += effectedCubes;
             *      MainMenu.Instance.setCubeCountText (_curLevelChunk.numCubes);
             * }
             */
        }