undo-redo for create tiled map and property holder

This commit is contained in:
2016-02-02 00:21:21 +06:00
parent 46e2e830b5
commit 1920b49e47
9 changed files with 236 additions and 46 deletions

View File

@@ -10,11 +10,11 @@ namespace IsoTools {
[ExecuteInEditMode, DisallowMultipleComponent]
public class IsoObject : MonoBehaviour {
// ------------------------------------------------------------------------
// ---------------------------------------------------------------------
//
// Mode
//
// ------------------------------------------------------------------------
// ---------------------------------------------------------------------
public enum Mode {
Mode2d,
@@ -32,11 +32,11 @@ namespace IsoTools {
}
}
// ------------------------------------------------------------------------
// ---------------------------------------------------------------------
//
// Size
//
// ------------------------------------------------------------------------
// ---------------------------------------------------------------------
[SerializeField]
Vector3 _size = Vector3.one;
@@ -76,11 +76,11 @@ namespace IsoTools {
get { return new Vector2(sizeX, sizeZ); }
}
// ------------------------------------------------------------------------
// ---------------------------------------------------------------------
//
// Position
//
// ------------------------------------------------------------------------
// ---------------------------------------------------------------------
[SerializeField]
Vector3 _position = Vector3.zero;
@@ -120,11 +120,11 @@ namespace IsoTools {
get { return new Vector2(positionX, positionZ); }
}
// ------------------------------------------------------------------------
// ---------------------------------------------------------------------
//
// TilePosition
//
// ------------------------------------------------------------------------
// ---------------------------------------------------------------------
public Vector3 tilePosition {
get { return IsoUtils.Vec3Round(position); }
@@ -158,11 +158,11 @@ namespace IsoTools {
get { return new Vector2(tilePositionX, tilePositionZ); }
}
// ------------------------------------------------------------------------
// ---------------------------------------------------------------------
//
// Internal
//
// ------------------------------------------------------------------------
// ---------------------------------------------------------------------
public class InternalState {
public bool Dirty = false;
@@ -178,11 +178,11 @@ namespace IsoTools {
public InternalState Internal = new InternalState();
// ------------------------------------------------------------------------
// ---------------------------------------------------------------------
//
// For editor
//
// ------------------------------------------------------------------------
// ---------------------------------------------------------------------
#if UNITY_EDITOR
Vector3 _lastSize = Vector3.zero;
@@ -203,11 +203,11 @@ namespace IsoTools {
}
#endif
// ------------------------------------------------------------------------
// ---------------------------------------------------------------------
//
// Functions
//
// ------------------------------------------------------------------------
// ---------------------------------------------------------------------
IsoWorld _isoWorld = null;
public IsoWorld isoWorld {
@@ -270,11 +270,11 @@ namespace IsoTools {
#endif
}
// ------------------------------------------------------------------------
// ---------------------------------------------------------------------
//
// Messages
//
// ------------------------------------------------------------------------
// ---------------------------------------------------------------------
void Awake() {
Internal.SelfDepends = new HashSet<IsoObject>(new IsoObject[47]);
@@ -328,4 +328,4 @@ namespace IsoTools {
}
#endif
}
} // namespace IsoTools
} // namespace IsoTools