コード例 #1
0
        public void OnClickMapPlace(int id, ShipmentNodeType type)
        {
            ShipmentsAnswerCell cell = GetCurrentAnswerCell();

            if (cell.Type == AnswerCellType.Numeric)
            {
                SoundController.GetController().PlayDropSound();
            }
            else
            {
                SoundController.GetController().PlayTypingSound();
                cell.Value = id;
                cell.GetComponent <Image>().sprite = GetCellSprite(id, type);
                List <ShipmentsAnswerCell> cells = GetAnswerCells();
                if (type == ShipmentNodeType.Other && _currentFocus + 2 < cells.Count && _currentFocus % 3 == 1)
                {
                    ShipmentsAnswerCell cell2 = cells[_currentFocus + 2];
                    cell2.Value = id;
                    cell2.GetComponent <Image>().sprite = GetCellSprite(id, type);
                }
                else if (type == ShipmentNodeType.Other && _currentFocus - 2 > 0 && _currentFocus % 3 == 0)
                {
                    ShipmentsAnswerCell cell2 = cells[_currentFocus - 2];
                    cell2.Value = id;
                    cell2.GetComponent <Image>().sprite = GetCellSprite(id, type);
                }
                FocusNextEmptyCell();
            }
        }
コード例 #2
0
 public void SetData(int id, Sprite placesSprite, Sprite crossSprite, ShipmentNodeType type)
 {
     this.Id = id;
     CrossReference.sprite         = crossSprite;
     GetComponent <Image>().sprite = placesSprite;
     Type = type;
     CrossReference.gameObject.SetActive(Type != ShipmentNodeType.Start);
 }
コード例 #3
0
 private Sprite GetCellSprite(int id, ShipmentNodeType type)
 {
     return(type != ShipmentNodeType.Start ? AnswerCellSprites[id] : StartSpriteCell);
 }