actually remove old undo from history
parent
7d844f7b04
commit
4ba96b70a5
|
|
@ -33,6 +33,8 @@ namespace VelNet
|
||||||
objects[i].networkObject.TakeOwnership();
|
objects[i].networkObject.TakeOwnership();
|
||||||
objects[i].UnpackState(lastStates[i]);
|
objects[i].UnpackState(lastStates[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
undoBuffer.RemoveAt(undoBuffer.Count - 1);
|
||||||
if (debugLog) Debug.Log($"Undo {objects.Count} objects");
|
if (debugLog) Debug.Log($"Undo {objects.Count} objects");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -57,7 +59,6 @@ namespace VelNet
|
||||||
undoBuffer.RemoveAt(0);
|
undoBuffer.RemoveAt(0);
|
||||||
if (debugLog) Debug.Log($"Reached maximum undo history");
|
if (debugLog) Debug.Log($"Reached maximum undo history");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int UndoHistoryLength()
|
public int UndoHistoryLength()
|
||||||
|
|
@ -65,7 +66,7 @@ namespace VelNet
|
||||||
return undoBuffer.Count;
|
return undoBuffer.Count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
[CustomEditor(typeof(UndoGroup))]
|
[CustomEditor(typeof(UndoGroup))]
|
||||||
public class UndoGroupEditor : Editor
|
public class UndoGroupEditor : Editor
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "edu.uga.engr.vel.velnet",
|
"name": "edu.uga.engr.vel.velnet",
|
||||||
"displayName": "VelNet",
|
"displayName": "VelNet",
|
||||||
"version": "1.2.1",
|
"version": "1.2.2",
|
||||||
"unity": "2019.1",
|
"unity": "2019.1",
|
||||||
"description": "A custom networking library for Unity.",
|
"description": "A custom networking library for Unity.",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue