예제 #1
0
파일: Cell.cs 프로젝트: shuitian/Odyssey
 public void SetPokemon(int pokemonID)
 {
     building.sprite = Pokedex.instance[pokemonID - 1].icon;
     _pokemonID      = pokemonID;
     building.gameObject.SetActive(true);
     ODData.UpdateCell(x, y, _pokemonID);
 }
예제 #2
0
 public void CreateCellsNearBy(int x, int y)
 {
     for (int i = 0; i < 4; i++)
     {
         int x1 = x + addedValues[i, 0];
         int y1 = y + addedValues[i, 1];
         if (x1 >= 0 && x1 < shipSize && y1 >= 0 && y1 < shipSize)
         {
             if (SpaceShip.shipCells[x1, y1] == (int)CellType.CanNotBuy)
             {
                 SpaceShip.shipCells[x1, y1] = (int)CellType.CanBuy;
                 CreateCanBuyBorder(x1, y1);
                 ODData.UpdateCell(x1, y1, (int)CellType.CanBuy);
             }
         }
     }
 }
예제 #3
0
파일: Cell.cs 프로젝트: shuitian/Odyssey
 public void BuyCell()
 {
     if (Player.instance.TryToAford(new Dictionary <int, float>()
     {
         { 1, _price }
     }))
     {
         SetCellType(CellType.Buyed);
         SpaceShip.shipCells[x, y] = (int)CellType.Buyed;
         SpaceShip.ownedCellNum++;
         ODData.UpdateCell(x, y, (int)CellType.Buyed);
         SpaceShip.instance.MoveCellToBuyedList(gameObject);
         SpaceShip.instance.CreateCellsNearBy(x, y);
         SpaceShip.instance.UpdateAllCellPrice();
         OnClickCell();
     }
     else
     {
         print("金币不够");
     }
 }