public void StartOverDialogue() { finishedCurrentDialogue = false; if (currentTextBox < descriptions[currentObjective].currentObjectivesKeyboard.Count) { dummyUIText.text = ""; dummyUIText.DOKill(); descriptionTextMesh.text = ""; switch (inputKeyUI.lastSeenControlScheme) { case KeyboardSchemeName: dummyUIText.DOText(descriptions[currentObjective].currentObjectivesKeyboard[currentTextBox], 4.5f, true); break; case PS4SchemeName: dummyUIText.DOText(descriptions[currentObjective].currentObjectivesPS4[currentTextBox], 4.5f, true); break; case XBoxSchemeName: dummyUIText.DOText(descriptions[currentObjective].currentObjectivesXBox[currentTextBox], 4.5f, true); break; } } }
public void DOScanningPhase() { scanButtonText.text = "SCAN"; scanButton.interactable = true; movingPhaseText.DOKill(); movingPhaseText.color = Color.clear; playersSquare.DOVisualPlayer(); if (scanCount == 0) { playersSquare.neightbors[0].DOEnableVisualScan(); playersSquare.neightbors[1].DOEnableVisualScan(); playersSquare.neightbors[2].DOEnableVisualScan(); } else if (scanCount == 3) { playersSquare.neightbors[3].DOEnableVisualScan(); playersSquare.neightbors[1].DOEnableVisualScan(); playersSquare.neightbors[5].DOEnableVisualScan(); } else if (scanCount == 4) { playersSquare.neightbors[4].DOEnableVisualScan(); playersSquare.neightbors[2].DOEnableVisualScan(); playersSquare.neightbors[5].DOEnableVisualScan(); } }
public void Init(TalkableCharacter _char, NarrativeDialog dialog) { character = _char; type = dialog.type; if (m_text != null) { m_text.DOKill(); m_text.text = dialog.word; // m_text.DOText( dialog.word , dialog.word.Length * 0.06f + 0.3f ); m_text.DOFade(1f, showUpTime); } if (m_backImage != null) { m_backImage.transform.localScale = Vector3.one * 0.01f; m_backImage.transform.DOScale(1f, showUpTime); m_backImage.DOFade(backImageOriginalAlpha, showUpTime); } if (m_arrow != null) { m_arrow.DOFade(backImageOriginalAlpha, showUpTime); } UpdateDialogFramePosition(); }
public void Skip() { introText.DOKill(); StopCoroutine(textCoroutine); fadeImage.DOFade(1, 2f).OnStart(() => fadeImage.gameObject.SetActive(true)) .OnComplete(() => SceneManager.LoadScene("Play")); }
public void ShowText(float duration) { if (text != null) { text.enabled = true; text.DOKill(); text.DOFade(1f, duration / 2f); } }
void SetInGameScoreOut() { scoreIngame.DOKill(); RectTransform r = scoreIngame.GetComponent <RectTransform>(); var p = r.localPosition; p.y = Screen.height * 2; r.localPosition = p; }
public void ShowTextPrompt() { if (textPrompt != null) { textPrompt.text = promptString; textPrompt.text = textPrompt.text.Replace("{control}", GetControlString()); textPrompt.DOKill(); textPrompt.DOFade(1.0f, 0.5f); } }
void ShowCombo() { comboLabel.text = string.Format(comboFormat, comboCount); comboLabel.DOKill(); comboLabel.DOFade(1, judgementScaleTweenDuration); comboLabel.transform.DOScale(1.2f, judgementScaleTweenDuration * 2).OnComplete(() => { comboLabel.transform.DOScale(1f, judgementScaleTweenDuration).SetDelay(judgementScaleTweenDelay); comboLabel.DOFade(0.6f, judgementScaleTweenDuration).SetDelay(judgementScaleTweenDelay); }); }
public void ShowText(string text) { if (string.IsNullOrEmpty(view.text)) { bg.DOKill(); view.DOKill(); bg.DOFade(1f, 0.5f); view.DOFade(1f, 0.5f); } view.text = text; RectTransform bgRT = bg.GetComponent <RectTransform> (); bgRT.sizeDelta = new Vector2(view.preferredWidth + 60, bgRT.sizeDelta.y); }
void SetText(int index) { if (index >= dialogList.Count) { return; } dialogText.DOKill(); string text = dialogList[index]; dialogText.text = ""; dialogText.DOText(text, text.Length * Define.DoTextSpeedFast); }
public void updateColor() { Image image = this.gameObject.GetComponent <Image>(); Text text = this.gameObject.GetComponentInChildren <Text>(); Color backgroundColor; Color textColor; if (correctWord) { backgroundColor = new Color(hoverCorrectColor.r, hoverCorrectColor.g, hoverCorrectColor.b); textColor = new Color(hoverCorrectTextColor.r, hoverCorrectTextColor.g, hoverCorrectTextColor.b); } else if (connected) { backgroundColor = new Color(hoverColor.r, hoverColor.g, hoverColor.b); textColor = new Color(hoverTextColor.r, hoverTextColor.g, hoverTextColor.b); } else if (blasterDirection > 0) { backgroundColor = new Color(blasterColor.r, blasterColor.g, blasterColor.b); textColor = new Color(blasterTextColor.r, blasterTextColor.g, blasterTextColor.b); } else { backgroundColor = new Color(normalColor.r, normalColor.g, normalColor.b); textColor = new Color(normalTextColor.r, normalTextColor.g, normalTextColor.b); } image.DOKill(true); text.DOKill(true); image.DOColor(backgroundColor, 0.5f); text.DOColor(textColor, 0.5f); }
/* * IEnumerator loadScene() * { * //异步读取场景。 * //Globe.loadName 就是A场景中需要读取的C场景名称。 * async = Application.LoadLevelAsync(Globe.loadName); * * //读取完毕后返回, 系统会自动进入C场景 * yield return async; * * }*/ public void OnTextBoxClick() { bool nextStep = false; if (TextBox.DOComplete() >= 0) { _currentStep++; nextStep = true; } else { TextBox.DOKill(); TextBox.text = TextString[_currentText]; } if (_currentStep == 1 && nextStep) { _currentText++; Alien.gameObject.SetActive(false); Player.gameObject.SetActive(true); TextBox.text = ""; TextBox.DOText(TextString[_currentText], 1, false); } else if (_currentStep == 2) { Application.LoadLevel(SceneToLoad); } }
private void Init() { _icon.color = _defaultIconColor; _content.color = _defaultContentColor; _icon.DOKill(); _content.DOKill(); }
void OnInitEquippedWeapon(GameObject weapon) { textComponent = gameObject.GetComponent <Text>(); textComponent.text = weapon.GetComponent <Weapon>().title; textComponent.DOKill(); FadeInInitialTitle(); }
void OnInitInteger(int initInt) { textComponent = gameObject.GetComponent <Text>(); textComponent.text = legend + initInt.ToString(); textComponent.DOKill(); FadeInText(); }
public void AddScore(int value, int curentScore) { scoreText.gameObject.SetActive(true); addScoreText.DOKill(true); scoreText.DOKill(true); addScoreText.gameObject.SetActive(true); SetTxt(value, addScoreText, "+"); addScoreText.DOFade(1f, scoreAnimationTime / 4f).OnComplete(() => { var animTime = scoreAnimationTime / 2f; float deltaTime = 0f; addScoreText.DOFade(1f, animTime).OnUpdate(() => { deltaTime += Time.deltaTime; var newTime = (int)(value * (1 - deltaTime / animTime)); SetTxt(newTime, addScoreText, "+"); SetTxt(curentScore - value + (value - newTime), scoreText); }).OnComplete(() => { SetTxt(0, addScoreText, "+"); SetTxt(curentScore, scoreText); addScoreText.DOFade(0f, scoreAnimationTime / 4f); }); }); }
public static void Kill(Transform trans) { foreach (Transform ts in trans) { if (ts.childCount > 0) { Kill(ts); } ts.DOKill(); Image image = ts.GetComponent <Image>(); if (image != null) { image.DOKill(); } Text text = ts.GetComponent <Text>(); if (text != null) { text.DOKill(); } RectTransform tr = ts.GetComponent <RectTransform>(); if (tr != null) { tr.DOKill(); } } }
void OnInitEquippedWeapon(GameObject weapon) { textComponent = gameObject.GetComponent<Text>(); textComponent.text = weapon.GetComponent<Weapon>().title; textComponent.DOKill(); FadeInInitialTitle(); }
void OnInitInteger(int initInt) { textComponent = gameObject.GetComponent<Text>(); textComponent.text = legend + initInt.ToString(); textComponent.DOKill(); FadeInText(); }
public void ShowHint(string info) { mHing.DOKill(); mHing.text = info; mHing.DOFade(1f, 1f).OnComplete(() => { mHing.DOFade(0f, 1f).SetDelay(1f); }); }
static void HideToast() { if (Panel != null) { if (Background != null) { Background.enabled = false; Background.DOKill(); } if (Message != null) { Message.DOKill(); Message.enabled = false; } Panel.gameObject.SetActive(true); } }
public void UpdateScore(int level) { scoreText.text = "" + level; scoreText.DOKill(); DOTween.To(() => scoreText.fontSize, x => scoreText.fontSize = x, 55, 0.1f).OnComplete(() => { DOTween.To(() => scoreText.fontSize, x => scoreText.fontSize = x, 40, 0.1f); }); }
public void UpdateCoins() { coinsText.text = "" + playerData.coins; coinsText.DOKill(); DOTween.To(() => coinsText.fontSize, x => coinsText.fontSize = x, 40, 0.1f).OnComplete(() => { DOTween.To(() => coinsText.fontSize, x => coinsText.fontSize = x, 30, 0.1f); }); }
private void ShowStatus() { m_txtStatus.gameObject.SetActive(true); m_txtStatus.DOKill(); m_txtStatus.color = colorText; Sequence mySequence = DOTween.Sequence(); mySequence.Append(DOTween.ToAlpha(() => m_txtStatus.color, x => m_txtStatus.color = x, 1, m_timeShow)); mySequence.InsertCallback(m_timeShow + 0.5f, HideStatus); }
void HintShow(string text, bool fade = true) { hint.color = new Color(1, 0, 0, 1); hint.text = text; if (fade) { hint.DOKill(); hint.DOFade(0f, 1f).SetDelay(1f); } }
private static void SetWithAnimation(int start, Action <int> action, Text text) { text.DOKill(); var delta = GetRandomDelta(); var animationTime = Math.Abs(delta * AnimationTimeMultiplier); var end = Mathf.Clamp(start + delta, MinStatValue, MaxStatValue); DOTween.To(() => start, action.Invoke, end, animationTime) .OnComplete(() => { action.Invoke(end); }) .OnKill(() => { action.Invoke(end); }); }
public void DOStart() { InputTouch.OnTouched -= OnTouched; FindObjectOfType <Floor>().DOEnable(); DOCreateDot(); title.DOKill(); instruction.DOKill(); textScore.DOKill(); title.DOFade(0, 1); instruction.DOFade(1, 1).OnComplete(() => { instruction.DOFade(0, 1).SetDelay(3); }); textScore.DOFade(0.0f, 1).OnComplete(() => { point = 0; textScore.DOFade(0.5f, 1); }); }
private void Start() { TxtScore.text = GameController.Score.ToString(); TxtBestScore.text = PlayerPrefs.GetInt("bestScore").ToString(); //TxtBestScore.text = GameController.BestScore.ToString(); GameController.OnBestScoreChanged += () => { TxtBestScore.text = GameController.BestScore.ToString(); }; GameController.OnScoreChanged += () => { TxtScore.DOKill(); _scoreTween = DOVirtual.Float(int.Parse(TxtScore.text), GameController.Score, .3f, f => { TxtScore.text = ((int)f).ToString(); }).SetEase(Ease.Linear); }; }
private void HideAlertText() { // If player placed and it is still queued to alert him stop it if (alertCoroutine != null) { StopCoroutine(alertCoroutine); } // If alertext is shown fade it out if (alertText.color.a > 0) { alertText.DOKill(); alertText.DOFade(0f, 1.5f); } }
public void ShowDialogue() { dialogueText.DOKill(); sfxAudiosource.PlayOneShot(memoryClip); dialogueText.DOColor(Color.clear, 1f).OnComplete(() => { dialogueText.text = string.Empty; dialogueText.color = Color.white; dialogueText.DOText(dialogues[currentDialogue], 4f); dialogueText.DOColor(Color.clear, 1f).SetDelay(6f); currentDialogue++; }); }
void OnClickGetOrder(PointerEventData evt) { if (GameManager.Instance.GameState != GameState.Idle) { return; } Text text = GetText((int)Texts.OrderText); if (text.text != orderText) { text.DOKill(); text.text = orderText; } GameManager.Instance.GameState = GameState.Select; }
public void SetItemStatus(bool isCurrentDay) { if (isCurrentDay) { ivBackground.DOKill(); ivBackground.color = Color.white; ivBackground.DOColor(new Color(1f, 0.5f, 0.5f), 1); tvDay.DOKill(); tvDay.transform.localScale = new Vector3(1, 1, 1); tvDay.transform.DOScale(new Vector3(0.5f, 0.5f, 1), 1).From().SetEase(Ease.OutBack); } else { ivBackground.color = Color.white; } }
void Start() { HUDScore = gameObject.GetComponent<Text>(); HUDScore.DOKill(); }
void Start() { textComponent = gameObject.GetComponent<Text>(); textComponent.DOKill(); }