static public void AddToUndo(GameObject _gO, Vector2 _mousePos) { for (int i = 0; i < m_undoObjects.Count - m_undoPos; i++) { GameObject gO = m_undoObjects[m_undoObjects.Count - 1].GetObj(); if (gO.layer == LayerMask.NameToLayer("Path")) { LineScript.AddToPathPool(gO); } m_undoObjects.RemoveAt(m_undoObjects.Count - 1); } m_undoPos++; UndoItem uItem = new UndoItem(_gO, _gO.transform.position); m_undoObjects.Add(uItem); }
static public void AddToUndo(GameObject _gO) { int numOverUndo = m_undoObjects.Count - m_undoPos; for (int i = 0; i < numOverUndo; i++) { GameObject gO = m_undoObjects[m_undoObjects.Count - 1].GetObj(); if (gO.layer == LayerMask.NameToLayer("Path")) { LineScript.AddToPathPool(gO); } m_undoObjects.RemoveAt(m_undoObjects.Count - 1); } m_undoPos++; UndoItem uItem = new UndoItem(_gO); m_undoObjects.Add(uItem); }