Exemplo n.º 1
0
 public static void TriggerInventoryUICellEnter(CellInventory cellInventory, int index)
 {
     if (InventoryUICellEnter != null)
     {
         InventoryUICellEnter(cellInventory, index);
     }
 }
Exemplo n.º 2
0
 public static void TriggerFightInventories(CellInventory cellInv, int index)
 {
     if (FightInventories != null)
     {
         FightInventories(cellInv, index);
     }
 }
Exemplo n.º 3
0
 protected virtual void Awake()
 {
     cells.Add(this);
     Active           = true;
     Position         = transform.position;
     HeroesPosition   = transform.Find("positions/heroes").position;
     MovablesPosition = transform.Find("positions/movables").position;
     TokensPosition   = transform.Find("positions/tokens").position;
     Index            = int.Parse(this.name);
     Inventory        = new CellInventory(Index);
 }
Exemplo n.º 4
0
    public void RemoveTokenCell(Token token, CellInventory inv)
    {
        int objectIndex = inv.AllTokens.IndexOf(token);

        if (objectIndex == -1)
        {
            return;
        }
        int cellIndex = inv.cellID;

        photonView.RPC("RemoveTokenCellRPC", RpcTarget.AllViaServer, new object[] { objectIndex, cellIndex });
    }
Exemplo n.º 5
0
    void UpdateUIEnter(CellInventory cellInv, int index)
    {
        if (!isLockedFight || index == fightIndex)
        {
            if (!isLocked)
            {
                this.index = index;
                InventorySpotCell.cellIndex = index;

                for (int i = 0; i < spots.Length; i++)
                {
                    if (i < cellInv.AllTokens.Count)
                    {
                        if (cellInv.AllTokens[i] == null)
                        {
                            continue;
                        }
                        spots[i].AddItem(cellInv.AllTokens[i]);
                    }
                    else if (i < cellInv.items.Count + cellInv.AllTokens.Count)
                    {
                        if (cellInv.items[i - cellInv.AllTokens.Count] == null)
                        {
                            continue;
                        }
                        spots[i].AddItem((Token)cellInv.items[i - cellInv.AllTokens.Count]);
                    }
                    else
                    {
                        spots[i].ClearSpot();
                    }
                }

                titleTransformGraphic.GetComponent <Text>().text = "Cell: " + index;
                titleTransformGraphic.gameObject.SetActive(true);
            }
        }
    }
Exemplo n.º 6
0
 void UpdateUIFight(CellInventory cellInv, int index)
 {
     UpdateUIEnter(cellInv, index);
     isLockedFight = true;
     fightIndex    = index;
 }
Exemplo n.º 7
0
 public void ForceUpdate(CellInventory inv, int index)
 {
     isLocked = false;
     UpdateUIEnter(inv, index);
 }