void DoShow(Action _onContinue, ContinueScreenMode _mode = ContinueScreenMode.ButtonWithBg) { Debug.Log("ContinueScreen DoShow " + _onContinue); IsShown = true; clicked = false; currMode = _mode; onContinueCallback = _onContinue; Bg.gameObject.SetActive(_mode != ContinueScreenMode.Button); BtContinue.gameObject.SetActive(_mode != ContinueScreenMode.FullscreenBg); if (btIdleTween != null) { btIdleTween.Rewind(); } btIdleTween = btRT.DOAnchorPosX(10, 0.5f).SetRelative().SetEase(Ease.InOutQuad).SetLoops(-1, LoopType.Yoyo) .SetUpdate(true).SetAutoKill(false).Pause(); if (_mode == ContinueScreenMode.ButtonFullscreen) { SideSnapshot.Apply(btRT, IcoContinue); } else { CenterSnapshot.Apply(btRT, IcoContinue); } showBgTween.Rewind(); showTween.Restart(); if (_mode != ContinueScreenMode.Button && _mode != ContinueScreenMode.ButtonFullscreen) { showBgTween.PlayForward(); } this.gameObject.SetActive(true); }
void Update() { // SceneTransitioner - SPACE to show/hide if (Input.GetKeyDown(KeyCode.Space)) { SceneTransitioner.Show(!SceneTransitioner.IsShown); } // Subtitles - T to show text, SHIFT+T to show keeper text, CTRL/CMD+T to close if (WidgetSubtitles.I != null) { if (Input.GetKeyDown(KeyCode.T)) { if (Input.GetKey(KeyCode.LeftControl) || Input.GetKey(KeyCode.RightControl) || Input.GetKey(KeyCode.LeftCommand) || Input.GetKey(KeyCode.RightCommand)) { WidgetSubtitles.I.Close(); } else { var testData = new Database.LocalizationData(); testData.Arabic = "من فضلك، حاول اصطياد البعض منها. من فضلك، حاول التقاطها."; WidgetSubtitles.I.DisplaySentence(testData, 2, Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift)); } } } // Continue button - C to show, SHIFT+C to show fullscreen-button on the side if (WidgetSubtitles.I != null) { if (Input.GetKeyDown(KeyCode.C)) { ContinueScreenMode continueScreenMode = Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift) // ? ContinueScreenMode.FullscreenBg : ContinueScreenMode.ButtonWithBgFullscreen; ? ContinueScreenMode.ButtonFullscreen : ContinueScreenMode.ButtonWithBg; ContinueScreen.Show(null, continueScreenMode); } } // Popup - P to show/hide if (Input.GetKeyDown(KeyCode.P)) { WidgetPopupWindow.I.Show(!WidgetPopupWindow.IsShown); } }
// ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ // ■■■ PUBLIC METHODS /// <summary> /// Call this to show/hide the continue screen. /// </summary> /// <param name="_onContinue">Eventual callback to call when the user clicks to continue</param> /// <param name="_mode">Mode</param> public static void Show(Action _onContinue, ContinueScreenMode _mode = ContinueScreenMode.ButtonWithBg, bool _pulseLoop = false) { GlobalUI.Init(); GlobalUI.ContinueScreen.DoShow(_onContinue, _mode, _pulseLoop); }
// ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ // ■■■ PUBLIC METHODS /// <summary> /// Call this to show/hide the continue screen. /// </summary> /// <param name="_onContinue">Eventual callback to call when the user clicks to continue</param> /// <param name="_mode">Mode</param> public static void Show(Action _onContinue, ContinueScreenMode _mode = ContinueScreenMode.ButtonWithBg) { GlobalUI.Init(); GlobalUI.ContinueScreen.DoShow(_onContinue, _mode); }