void _update(float f) { if (m_Unit == null) { m_Unit = Unit.GetAllUnitsOfOwner(0, true).FirstOrDefault(); if (m_Unit != null) { m_Unit.Inventory.OnInventoryUpdated += OnLoot; } } if (hint == null && canLoot() && !wait_for_hint) { StartCoroutine(DelayedHint()); } if (m_Loot == null && ArrowPrefab != null) { m_Loot = GameObject.FindObjectOfType <Tile_Loot>(); if (m_Loot != null) { _spawned_arrow = ArrowPrefab.Instantiate(m_Loot.transform, true); } } }
protected override void ActionExecuted(Component target) { Tile_Loot l = target.GetComponent <Tile_Loot>(); l.OnLoot(Owner); StartCoroutine(DelayedCompletion(1f)); }
void OnDeath(Unit u) { if (u == m_unit) { Tile_Loot.AddLoot(u.currentTile, cat); } }
public void OnTileSelect(Tile selected_tile) { if (!GetLootableTiles().Contains(selected_tile)) { ToastNotification.SetToastMessage2("No Loot on this Tile"); return; } Tile_Loot loot = selected_tile.GetComponent <Tile_Loot>(); if (loot.GetLootableAmount(Owner) == 0) { ToastNotification.SetToastMessage2("Unit has no space for " + loot.GetLootableAmount(Owner) + "" + LootBalance.GetPlayerFacingString(loot.GetLootType()) + " "); return; } AttemptAction(selected_tile); }
void Start() { // MDebug.Log("add for " + Category); Tile_Loot.AddLoot(this.GetComponent <Tile>(), Category); Destroy(this); }