示例#1
0
        private void GameInit()
        {
            score = 0;
            destinationsAmount = 8;
            currentLevel       = 1;
            ingameUi.UpdateScore(score);
            lives = 10;
            ingameUi.UpdateLives(lives);
            currentParams = startingParams;


            // Clean up so we can rerandomize properties for next game
            currentlyUsedProperties.Clear();
            while (currentlyUsedProperties.Count < 4)
            {
                string propertyToAdd = globalDestinationProperties[Random.Range(0, globalDestinationProperties.Count)];
                currentlyUsedProperties.Add(propertyToAdd);
            }
            List <string> spawnerDestinations = new List <string>();
            int           i = 0;

            foreach (string str in currentlyUsedProperties)
            {
                Destinations[i].ClearDestinations();
                Destinations[i].AddDestionations(str);
                spawnerDestinations.Add(str);
                i++;
            }
            spawner.SetNewSpawnParams(spawnerDestinations);
        }