Ejemplo n.º 1
0
    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);
            }
        }
    }
Ejemplo n.º 2
0
    protected override void ActionExecuted(Component target)
    {
        Tile_Loot l = target.GetComponent <Tile_Loot>();

        l.OnLoot(Owner);
        StartCoroutine(DelayedCompletion(1f));
    }
Ejemplo n.º 3
0
 void OnDeath(Unit u)
 {
     if (u == m_unit)
     {
         Tile_Loot.AddLoot(u.currentTile, cat);
     }
 }
Ejemplo n.º 4
0
    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);
    }
Ejemplo n.º 5
0
 void Start()
 {
     // MDebug.Log("add for " + Category);
     Tile_Loot.AddLoot(this.GetComponent <Tile>(), Category);
     Destroy(this);
 }