示例#1
0
 private void InitializeEscortDeckIcons(EscortDeckModel escortDeckModel)
 {
     for (int i = 0; i < DeployShips.Length; i++)
     {
         if (i < escortDeckModel.Count)
         {
             DeployShips[i].Initialize(escortDeckModel.GetShip(i));
         }
         else
         {
             DeployShips[i].InitializeDefailt();
         }
     }
 }
        public void UpdateEscortDeck(EscortDeckModel deck)
        {
            bool flag = Banner.ShipModel == null || Banner.ShipModel != deck.GetFlagShip();

            Banner.SetShipData(deck.GetFlagShip());
            for (int i = 0; i < shipTypeIcons.Length; i++)
            {
                ShipModel ship = deck.GetShip(i + 1);
                if (ship != null)
                {
                    shipTypeIcons[i].spriteName = ShipTypeIconName[ship.ShipType];
                    ChangeColor(ship, shipTypeIcons[i]);
                }
                else
                {
                    shipTypeIcons[i].spriteName = string.Empty;
                }
            }
            if (flag)
            {
                updateView(0.2f);
            }
        }