public void instantiate() { if(map != null) { clear(); map = new GenericGridMap<IsoObject>(tileSize, size); map.applyFunctionToMap((x, y, z) => mapToTile(x, y, z)); } else { map = new GenericGridMap<IsoObject>(tileSize, size); map.applyFunctionToMap((x, y, z) => mapToTile(x, y, z)); } }
public void instantiate() { if (Map != null) { Clear(); } if (_root == null) { _root = new GameObject("Level"); } Map = new GenericGridMap <IsoTransform>(Prefab.Size, WorldSize); Map.applyFunctionToMap((x, y, z) => MapToTile(x, y, z)); for (int i = 0; i < Map.tiles.Length; i++) { if (Map.tiles[i] != null) { Map.tiles[i].transform.parent = _root.transform; } } }
/// <summary> /// Initialized all values /// </summary> /// <param name="map"></param> /// <param name="startPosInMap"></param> public void init(GenericGridMap<IsoObject> map, Vector3 startPosInMap) { this.map = map; this.positionInMap = startPosInMap; }
/// <summary> /// Wraps GenericGridMap<T>.clear() for the custom editor /// </summary> public void clear() { map.clear(); map = null; }
/// <summary> /// Wraps GenericGridMap<T>.clear() for the custom editor /// </summary> public void Clear() { Map.clear(); Map = null; DestroyImmediate(_root); }