コード例 #1
0
ファイル: Think.cs プロジェクト: engagementgamelab/AtStake_v2
		protected override void OnInitDeciderElements () {

			timerElDecider = new TimerButtonElement (GetButton ("timer_button_decider"), Duration, () => {
													Game.Dispatcher.ScheduleMessage ("StartTimer");
													Game.Audio.Play ("timer_start");
												}, () => {
													Advance ();
													Game.Audio.Play ("alarm");
												});
			Elements.Add ("timer_button", timerElDecider);

			// The skip button is only shown if a client was dropped (so that players don't need to wait for the timer to run down again)
			Elements.Add ("skip", new ButtonElement (GetButton ("skip"), () => {
				Advance ();
			}) { Active = droppedClient });
		}
コード例 #2
0
ファイル: View.cs プロジェクト: engagementlab/AtStake_v2
        /// <summary>
        /// On a screen with timers, checks how much time has elapsed
        /// </summary>
        /// <returns>The amount of time that has elapsed</returns>
        protected int GetElapsedTime()
        {
            float e;

            if (IsDecider)
            {
                TimerButtonElement t = GetScreenElement <TimerButtonElement> ("timer_button");
                e = t.Progress * t.Duration;
            }
            else
            {
                TimerElement t = GetScreenElement <TimerElement> ("timer");
                e = t.Progress * t.Duration;
            }

            return((int)e);
        }
コード例 #3
0
ファイル: Think.cs プロジェクト: engagementlab/AtStake_v2
        protected override void OnInitDeciderElements()
        {
            timerElDecider = new TimerButtonElement(GetButton("timer_button_decider"), Duration, () => {
                Game.Dispatcher.ScheduleMessage("StartTimer");
                Game.Audio.Play("timer_start");
            }, () => {
                Advance();
                Game.Audio.Play("alarm");
            });
            Elements.Add("timer_button", timerElDecider);

            // The skip button is only shown if a client was dropped (so that players don't need to wait for the timer to run down again)
            Elements.Add("skip", new ButtonElement(GetButton("skip"), () => {
                Advance();
            })
            {
                Active = droppedClient
            });
        }
コード例 #4
0
ファイル: View.cs プロジェクト: engagementlab/AtStake_v2
        protected void SyncElapsedTime()
        {
            float e;

            if (IsDecider)
            {
                TimerButtonElement t = GetScreenElement <TimerButtonElement> ("timer_button");
                e = t.Remaining;
                Debug.Log(t.Progress);
            }
            else
            {
                TimerElement t = GetScreenElement <TimerElement> ("timer");
                e = t.Remaining;
                Debug.Log(t.Progress);
            }

            Debug.Log("SyncElapsedTime: " + e);

            Game.Multiplayer.SyncDuration(e);
        }