Ejemplo n.º 1
0
    void Start()
    {
        for (int i = 0, j = 0; i < AsteroidPoolSize; i++)
        {
            if (_asteroidPool[i] != null)
            {
                newAsteroids++;
            }
        }
        checkEditor();
        _restartButton.gameObject.SetActive(false);
        _youLoseLabel.gameObject.SetActive(false);
        CreateObjectPoolsAndTables();
        InitializeAsteroidsGridLayout();
        System.Array.Sort(_asteroids, new MyComparer());

        _playerTransform          = Instantiate(_spaceshipPrefab).transform;
        _playerTransform.position = new Vector3(
            GridDimensionFloat / 2f - 0.5f,
            GridDimensionFloat / 2f - 0.5f,
            0.3f);
        SpaceshipInfo ship = spaceshipRepository.LoadData();

        spaceshipRepository.SaveData(_spaceshipname.text, ship.highScore);
        ShipName = _spaceshipname.text;
    }
Ejemplo n.º 2
0
 public void ChooseSpaceship(SpaceshipInfo spaceshipInfo) //Выбор космического корабля
 {
     spaceshipDescriptionText.text  = "<size=25>" + spaceshipInfo.spaceshipName + "</size>";
     spaceshipDescriptionText.text += "\n" + spaceshipInfo.spaceshipDescription;
     if (spaceshipInfo.needScore > gameOptions.highScore)
     {
         playButton.interactable = false;
         playButtonText.text     = "Требуется " + spaceshipInfo.needScore + " очков";
     }
     else
     {
         playButton.interactable       = true;
         playButtonText.text           = "Играть!";
         gameOptions.selectedSpaceship = spaceshipInfo;
     }
 }