예제 #1
0
    public void UpdatePoints(GameObject kill, GameObject dead)
    {
        if (ActorsKills.ContainsKey(kill))
        {
            ActorsKills[kill] += 1;
            KillTableUI.Instance.UpdateScore(kill, ActorsKills[kill]);
            if (ActorsKills[kill] == maxPointsToWin)
            {
                MatchOver(kill);
            }

            ActorsDeaths[dead] += 1;
            Scoreboard.Instance.UpdateScoreBoard();
        }
    }
예제 #2
0
    public void StartMatch()
    {
        GameObject player = Instantiate(playerPrefab, m_spawnPointManager.GetRandomSpawnPoint(true), playerPrefab.transform.rotation);

        SceneManager.MoveGameObjectToScene(player, gameObject.scene);
        ActorsKills.Add(player, 0);
        ActorsDeaths.Add(player, 0);
        for (int i = 0; i < numberOfEnemies; i++)
        {
            GameObject go = Instantiate(enemyPrefab, m_spawnPointManager.GetRandomSpawnPoint(true), enemyPrefab.transform.rotation);
            SceneManager.MoveGameObjectToScene(go, gameObject.scene);
            ActorsKills.Add(go, 0);
            ActorsDeaths.Add(go, 0);
        }
    }