Example #1
0
    // Update is called once per frame
    void Update()
    {
        phase       = PhaseHandler.phase;
        roundCount  = PhaseHandler.roundCount;
        timeLeft    = PhaseHandler.timeLeft;
        leadingTeam = PhaseHandler.leadingTeam;
        title       = $"{phase} Phase";
        descriptionTextMesh.text = $"{title}\n{description}";

        if (phase == PhaseHandler.Phase.Action)
        {
            description = "Fight!\n";
        }

        if (phase == PhaseHandler.Phase.Decision)
        {
            description = "Select opponent and weapon!";
            descriptionTextMesh.text += $"\nTime left: {timeLeft.ToString("F0")} seconds";
        }

        if (phase == PhaseHandler.Phase.End)
        {
            string roundWord = roundCount == 1 ? "round" : "rounds";
            descriptionTextMesh.text = $"Total time: {PhaseHandler.passedGameSeconds.ToString("F0")}\nGame ended after {roundCount} {roundWord}.\nTeam {leadingTeam} won!";
        }
    }
 new void Update()
 {
     base.Update();
     phase         = PhaseHandler.phase;
     decisionPhase = transform.Find("LegoPaperScissors").GetComponent <DecisionPhase>();
     actionPhase   = transform.Find("LegoPaperScissors").GetComponent <ActionPhase>();
     // print($"player is {transform.name}, decision phase is from {decisionPhase.transform.parent.name}");
 }
Example #3
0
    // Update is called once per frame
    void Update()
    {
        phase           = PhaseHandler.phase;
        isDecisionPhase = phase == PhaseHandler.Phase.Decision;

        if (isDecisionPhase)
        {
            RemoveLeftHandWeapon();
        }
    }
Example #4
0
    // Update is called once per frame
    void Update()
    {
        phase       = PhaseHandler.phase;
        roundCount  = PhaseHandler.roundCount;
        timeLeft    = PhaseHandler.timeLeft;
        leadingTeam = PhaseHandler.leadingTeam;
        title       = $"{phase} Phase";

        // TODO time left should be set via interconnections group instead of here
        descriptionTextMesh.text = $"Time left: {(PhaseHandler.maxGameSeconds - PhaseHandler.passedGameSeconds).ToString("F0")} \nRound {roundCount}\n{leadingTeam} is leading.\n{description}";


        if (phase == PhaseHandler.Phase.End)
        {
            string roundWord = roundCount == 1 ? "round" : "rounds";
            descriptionTextMesh.text = $"Total time: {PhaseHandler.passedGameSeconds.ToString("F0")}\nGame ended after {roundCount} {roundWord}.\nTeam {leadingTeam} won!";
        }
    }
 void Update()
 {
     phase   = PhaseHandler.phase;
     players = PhaseHandler.players;
     GetWinners();
 }