Exemplo n.º 1
0
        private void Start()
        {
            playerStatsHandler = FindObjectOfType <PlayerStatsHandler>();

            playerScore.text = playerStatsHandler.GetScore().ToString();
            livesText.text   = playerStatsHandler.GetLivesLeft().ToString();
        }
Exemplo n.º 2
0
 private void OnCollisionEnter2D(Collision2D collision)
 {
     Debug.Log(collision.gameObject.tag);
     if (collision.gameObject.tag == "Player")
     {
         PlayerStatsHandler.Kill();
     }
 }
Exemplo n.º 3
0
 private void Awake()
 {
     if (instance != null)
     {
         Debug.LogWarning("Il y a plus d'une instance de PlayerStatsHandler dans la scène");
         return;
     }
     instance = this;
 }
    public void Consume(PlayerStatsHandler statsHandler)
    {
        foreach (ConsumableStat c in fills)
        {
            //Debug.Log("My nutrisional values are: " + c.statToFill + ": " + c.value);
            statsHandler.UpdateValue(c.statToFill, c.value);
        }

        Destroy(0);
    }
Exemplo n.º 5
0
    // Update is called once per frame
    void Update()
    {
        slider.value = CalculateSliderValue();

        if (TimeRemaining <= 0)
        {
            TimeRemaining = 0;
            PlayerStatsHandler.Kill();
        }

        else if (TimeRemaining > 0)
        {
            TimeRemaining -= Time.deltaTime;
        }
    }
Exemplo n.º 6
0
        public async Task Execute(IJobExecutionContext context)
        {
            Log.Warning($"--> Updating Database, MEM");

            var stopWatch = Stopwatch.StartNew();

            TeamStatsHandler.GetStats("psn", "teamstats");
            Log.Information($"PSN Standings updated");
            TeamStatsHandler.GetStats("xbox", "teamstats");
            Log.Information("Xbox Standings updated");
            var teamMem = GC.GetTotalMemory(false) / 1024 / 1024;

            Log.Information($"TeamStats MEM: {teamMem}, Time: {stopWatch.ElapsedMilliseconds}");
            stopWatch.Stop();

            var pWatch = Stopwatch.StartNew();

            PlayerStatsHandler.GetPlayerStats("psn", "playerstats");
            Log.Information($"PSN Field Players updated");
            PlayerStatsHandler.GetPlayerStats("xbox", "playerstats");
            Log.Information($"Xbox Field Players updated");

            var playerMem = GC.GetTotalMemory(false) / 1024 / 1024;

            Log.Information($"PlayerStats MEM: {playerMem}, Time {pWatch.ElapsedMilliseconds}");
            pWatch.Stop();

            var gWatch = Stopwatch.StartNew();

            GoalieStatsHandler.GetGoalieStats("psn", "goaliestats");
            Log.Information($"PSN Goalies updated");

            GoalieStatsHandler.GetGoalieStats("xbox", "goaliestats");
            Log.Information($"Xbox Goalies updated");

            var gMem = GC.GetTotalMemory(false) / 1024 / 1024;

            Log.Information($"GoalieStats MEM: {gMem}, Time {gWatch.ElapsedMilliseconds}");
            gWatch.Stop();
            var updateMem = GC.GetTotalMemory(false) / 1024 / 1024;

            Log.Warning($"--> Databases Updated, MEM: {updateMem}MB");


            Log.CloseAndFlush();
        }
Exemplo n.º 7
0
 private void Start()
 {
     gameMode    = FindObjectOfType <GameMode>();
     playerStats = FindObjectOfType <PlayerStatsHandler>();
 }
Exemplo n.º 8
0
 public void Yes()
 {
     PlayerStatsHandler.Respawn();
 }
Exemplo n.º 9
0
 public void No()
 {
     PlayerStatsHandler.Kill();
 }
Exemplo n.º 10
0
    // Use this for initialization
    void Start()
    {
        if (photonView.isMine)
        {
            //Get references.
            localSettings = GameObject.Find("LocalSettings").GetComponent <LocalSettings>();
            roundWinPanel = GameObject.Find("RoundWinTeamPanel");
            roundWinPanel.SetActive(false);

            movement   = GetComponent <PlayerMovement> ();
            cameraLook = GetComponent <CameraLook> ();

            roundTimerText  = GameObject.Find("RoundTimerText").GetComponent <Text>();
            timeLeft        = roundLengthInSecs;
            playerStats     = GetComponent <PlayerStatsHandler>();
            coundownFromEnd = roundFinishCooldown;

            analytics         = GameObject.FindGameObjectWithTag("Analytics").GetComponent <SendAnalyticInfo>();
            analytics.inMatch = true;

            gameManager = GameObject.Find("GameManager").GetComponent <GameManager>();
            playerShoot = GetComponent <PlayerShoot>();


            // 1st round
            roundCounter = GameObject.Find("RoundCounterText").GetComponent <Text>();

            roundTimerText.text = Mathf.CeilToInt(timeLeft).ToString();

            playerShoot.enabled = false;
            movement.enabled    = false;
            cameraLook.enabled  = false;
            startCountdown      = true;

            didYouWin = GameObject.Find("DidYouWin");
            didYouWin.SetActive(false);


            PunTeams.Team team          = PhotonNetwork.player.GetTeam();
            GameObject    teamTextThing = GameObject.Find("TeamDefineText");

            string teamS = "";
            if (team == PunTeams.Team.blue)
            {
                teamS = "blue"; teamTextThing.GetComponent <Text> ().color = Color.blue;
            }
            else if (team == PunTeams.Team.red)
            {
                teamS = "red"; teamTextThing.GetComponent <Text> ().color = Color.red;
            }


            teamTextThing.GetComponent <Text> ().text = "You are on " + teamS + " team.";
        }
        if (PhotonNetwork.isMasterClient)
        {
            roundTimerText      = GameObject.Find("RoundTimerText").GetComponent <Text>();
            sync                = syncEverySecs;
            timeLeft            = roundLengthInSecs;
            roundTimerText.text = Mathf.CeilToInt(timeLeft).ToString();
            coundownFromEnd     = roundFinishCooldown;
        }

        playerHealth = GetComponent <PlayerHealth>();
    }