public void EndGame()
    {
        //screenManager.Toggle_RetryMenu(true);
        GameActive = false;
        Collectibles.Clear();

        if (score > highscore)
        {
            highscore = score;
            //highScore.text = "New High\nScore:\n" + highscore.ToString();
            //currScoreRetry.enabled = false;
        }
        else
        {
            //highScore.text = "High\nScore:\n" + highscore.ToString();
            //currScoreRetry.enabled = true;
            //currScoreRetry.text = "current score: " + score.ToString();
        }

        //Connecting to AWS servers to feed data
        HeatMap sessionData = new HeatMap
        {
            ID       = System.Guid.NewGuid().ToString(),
            User     = PlayerPrefs.GetString("User"),
            Time     = System.DateTime.UtcNow.ToString(),
            GameType = "Abstract",
            Spawned  = SpawnedArray,
            Collect  = CollectArray,
        };

        AWSMan aws = new AWSMan();

        aws.CreateItem(sessionData);
    }
示例#2
0
    // Use this for initialization
    void Start()
    {
        aws = new AWSMan();
        Dictionary <string, AttributeValue> lastSession = aws.LastSession();

        if (lastSession != null)
        {
            foreach (AttributeValue value in lastSession["ObjectDifficultyArray"].L)
            {
                objectDifficultyArray.Add(int.Parse(value.N));
            }
        }
        else
        {
            objectDifficultyArray = objectDifficultyArrayDEFAULT;
        }

        List <int> usedObjects = new List <int>();

        //for (int i = 0; i < numCollectibles; i++)	usedObjects.Add(
        //select a random cannon to fire
        foreach (ObjSpawn location in spawnPoints)
        {
            int objectNum = Random.Range(0, numCollectibles);

            while (usedObjects.Contains(objectNum))
            {
                objectNum = Random.Range(0, numCollectibles);
            }

            usedObjects.Add(objectNum);
            location.Spawn(spawnObjects[objectNum]);
        }

        ObjectIndexArray.Add(nextObjectPicker());

        //EndGame();
    }