public GameTile(Vector3Int pos, bool isBlocked = false, MapResourceObject mapResourceSpawn = null) { this.position = pos; this.isBlocked = isBlocked; this.mapResourceSpawn = mapResourceSpawn; units = new HashSet <MapUnit>(); }
public void OnAfterDeserialize() { if (resourceID != -1 && GameManager.instance) { resourceObject = GameManager.instance.gamedatabaseManager.GetObject <MapResourceObject>(resourceID); if (resourceObject == null) { Destroy(gameObject); } else { } } }
public void SetItem(MapResourceObject resourceObject, int amount, int max, Vector3Int pos, MapResourceManager manager) { this.resourceObject = resourceObject; this.amount = amount; this.maxCapacity = max; this.manager = manager; icon.sprite = resourceObject.image; resourceType = resourceObject.resourceType; resourceID = resourceObject.id; //myShip = GameManager.instance.globalCountryManager.myCountry; position = pos; manager.resources.Add(this); }