IsoWorld static instance

This commit is contained in:
2016-04-17 19:20:43 +06:00
parent 8d5a177eb1
commit 7c22b52489
4 changed files with 24 additions and 9 deletions

View File

@@ -10,6 +10,8 @@ namespace IsoTools {
[ExecuteInEditMode, DisallowMultipleComponent]
public class IsoWorld : MonoBehaviour {
static IsoWorld _instance = null;
bool _dirty = false;
IsoAssocList<IsoObject> _objects = new IsoAssocList<IsoObject>();
IsoAssocList<IsoObject> _visibles = new IsoAssocList<IsoObject>();
@@ -129,6 +131,21 @@ namespace IsoTools {
}
}
// ---------------------------------------------------------------------
//
// Instance
//
// ---------------------------------------------------------------------
public static IsoWorld Instance {
get {
if ( !_instance ) {
_instance = GameObject.FindObjectOfType<IsoWorld>();
}
return _instance;
}
}
// ---------------------------------------------------------------------
//
// IsoToScreen/ScreenToIso