예제 #1
0
        void DeclineExtraTime(NetMessage msg)
        {
            // Update player timers
            if (!IsDecider)
            {
                TimerElement timer = GetScreenElement <TimerElement> ("timer");
                timer.Text = GetButton(IsNextPitcher ? "pitching" : "listening");
                timer.Type = IsNextPitcher ? TimerType.Pitch : TimerType.Listen;
                timer.Reset();
                return;
            }

            // Decider logic
            state = State.Pitch;
            Game.Controller.NextPitch();
            if (CurrentPitcher != "")
            {
                AllGotoView("pitch");
                SetDeciderInstructionsText("next_up");
                TimerButton.Reset(Duration);
            }
            else
            {
                AllGotoView("deliberate_instructions");
            }
        }
예제 #2
0
        void StartTimer(NetMessage msg)
        {
            if (HasElement("timer"))
            {
                float duration = msg.str1 == "deliberate"
                                        ? Duration
                                        : ExtraTimeDuration;

                TimerElement timer = GetScreenElement <TimerElement> ("timer");
                timer.Reset(duration);
                timer.StartTimer();
            }
            state = State.Extra;
        }
예제 #3
0
        void StartTimer(NetMessage msg)
        {
            if (IsDecider)
            {
                return;
            }

            float duration = msg.str2 == "pitch"
                                ? Duration
                                : ExtraTimeDuration;

            // Start the timer
            TimerElement timer = GetScreenElement <TimerElement> ("timer");

            timer.Reset(duration);
            timer.StartTimer();
        }
예제 #4
0
        void RefreshTimer(NetMessage msg)
        {
            // Game.Controller.SetWinner (msg.str1);
            // GotoView ("winner");
            Debug.Log("RefreshTimer: " + msg.flVal);

            if (timerElPlayer != null)
            {
                timerElPlayer.Progress = msg.flVal;
                timerElPlayer.Reset(msg.flVal);
                timerElPlayer.StartTimer(msg.flVal);
            }
            if (timerElDecider != null)
            {
                timerElDecider.Progress = msg.flVal;
                timerElDecider.Reset(msg.flVal);
            }
        }