public static colorText ( |
||
rectTransform | ||
to | Color | |
time | float | |
return | LTDescr, |
public void Init(Vector3 worldPosition, int score) { _rectTransform = GetComponent <RectTransform>(); Vector3 screenPosition = Camera.main.WorldToScreenPoint(worldPosition); Vector3 canvasPosition = Utility.ConvertScreenPositionToCanvasPosition(KinectInputModule.Instance.TargetCanvas, screenPosition); _rectTransform.anchoredPosition = canvasPosition; if (score == 1) { TargetText.text = " 1 plus "; } else { if (score >= 0) { TargetText.text = "Perfect " + string.Format("+{0:00}", score); TargetGradient.EffectGradient = RightGradient; } else { // TargetText.text ="Opp "+ string.Format("{0:00}", score); TargetText.text = "Opp!"; TargetGradient.EffectGradient = WrongGradient; } } TargetText.color = FromColor; LeanTween.colorText(TargetText.rectTransform, ToColor, Time / 2.1f).setDelay(Time / 2.1f); Vector3 targetPosition = canvasPosition + Distance; LeanTween.move(_rectTransform, targetPosition, Time).setOnComplete(OnTweenComplete); }
protected override void PointerGuiAreaEnter(BaseEventData data) { base.PointerGuiAreaEnter(data); LeanTween.colorText(textToChange.rectTransform, selectColor, timeToFade); // textToChange.color = selectColor; }
private void AnimateTextFlash(Text text) { Color tempColor = text.color; RectTransform rect = text.GetComponent <RectTransform>(); LeanTween.colorText(rect, Color.white, 0.1f).setOnComplete( () => { LeanTween.colorText(rect, tempColor, 0.1f); }); }
void RefreshData() { if (actionCountDown != null) { StopCoroutine(actionCountDown); actionCountDown = null; } if (tweenHighlight != null) { LeanTween.cancel(tweenHighlight.uniqueId); tweenHighlight = null; } if (DataManager.instance.subsidyData.CanRecieveReward()) { Color _c = Color.white; _c = txtGetGold_Small.color; _c.a = 0f; txtGetGold_Small.color = _c; _c = txtCountDown.color; _c.a = 0f; txtCountDown.color = _c; panelShadow.gameObject.SetActive(false); txtGetGold_Large.color = Color.black; tweenHighlight = LeanTween.colorText(txtGetGold_Large.rectTransform, Color.red, 0.3f).setEase(LeanTweenType.easeInOutCirc).setLoopPingPong(-1); } else { Color _c = txtGetGold_Small.color; _c.a = 1f; txtGetGold_Small.color = _c; _c = txtCountDown.color; _c.a = 1f; txtCountDown.color = _c; _c = txtGetGold_Large.color; _c.a = 0f; txtGetGold_Large.color = _c; panelShadow.gameObject.SetActive(true); System.TimeSpan _tmpDeltaTime = DataManager.instance.subsidyData.timeToGetReward - System.DateTime.Now; txtCountDown.text = string.Format("{0:00}:{1:00}", _tmpDeltaTime.Minutes + ((_tmpDeltaTime.Hours + (_tmpDeltaTime.Days * 24)) * 60), _tmpDeltaTime.Seconds); if (actionCountDown != null) { StopCoroutine(actionCountDown); actionCountDown = null; } actionCountDown = DoActionCountDown(); StartCoroutine(actionCountDown); } }
void ShowEffCanNotGetReward() { countDownShakeController.SetUpShakeWorldPoint(0.2f); LeanTween.scale(txtCountDown.gameObject, Vector3.one * 1.2f, 0.2f).setLoopPingPong(1).setEase(LeanTweenType.easeOutBack); LeanTween.colorText(txtCountDown.rectTransform, Color.red, 0.2f).setLoopPingPong(1).setEase(LeanTweenType.easeOutBack); CoreGameManager.instance.DoVibrate(); MyAudioManager.instance.PlaySfx(GetGoldScreenController.instance.sfx_NotThisTime); }
private void UpdateScore() { SoundManager.Instance.PlaySfx(SoundManager.SfxType.SCORE); this.nowSocre += this.addScore; this.txtScore.text = string.Format(StringHelper.FORMAT_NUMBER, this.nowSocre); this.txtAddScore.text = string.Format(StringHelper.FORMAT_ADD_SCORE, this.addScore); this.addScore = 0; LeanTween.colorText(this.txtAddScore.rectTransform, Color.yellow, TIEM_MIDDLE_ANIM).setLoopPingPong(1); }
public void OnPointerExit(PointerEventData eventData) { LeanTween.move(gameObject, startingPosition, tweenOutTime).setEase(LeanTweenType.easeInOutCubic); LeanTween.colorText(text, textColor, tweenOutTime).setEase(LeanTweenType.easeInOutCubic); LeanTween.color(bgPanelSelected, bgPanelSelectedColor, tweenOutTime).setEase(LeanTweenType.easeInOutCubic); LeanTween.color(bgPanel, bgPanelColor, tweenInTime).setEase(LeanTweenType.easeInOutCubic); if (menuManager) { menuManager.HideDescription(); } }
public void ShowWarning(string text) { if (string.IsNullOrEmpty(text)) { return; } StopWarningColorTween(); WarningText.text = text; _warningColorDescr = LeanTween.colorText(WarningText.rectTransform, WarningToColor, 0.1f); }
public void ChangeColor(string __destKey, float __delay = 0) { if (_isCurrentTwnAvail && LeanTween.isTweening(_currentTwn)) { return; } _isCurrentTwnAvail = true; try { switch (twnData.targetType) { case TwnColor.TargetType.gameObject: // Leantween method _currentTwn = LeanTween.color(twnData.target, twnData.GetValue(__destKey), twnData.time).setEase(twnData.tweenType).setDelay(__delay).setIgnoreTimeScale(twnData.ignoreTimeScale).setOnComplete(() => { twnData.callBack(); }).id; break; case TwnColor.TargetType.imgComp: // Leantween method _currentTwn = LeanTween.color(twnData.target.GetComponent <RectTransform>(), twnData.GetValue(__destKey), twnData.time).setEase(twnData.tweenType).setDelay(__delay).setIgnoreTimeScale(twnData.ignoreTimeScale).setOnComplete(() => { twnData.callBack(); }).id; break; case TwnColor.TargetType.canvasGroup: // LeanTween method _currentTwn = LeanTween.alphaCanvas(twnData.target.GetComponent <CanvasGroup>(), twnData.GetValue(__destKey).w, twnData.time).setEase(twnData.tweenType).setDelay(__delay).setIgnoreTimeScale(twnData.ignoreTimeScale).setOnComplete(() => { twnData.callBack(); }).id; break; case TwnColor.TargetType.txtComp: // Leantween method _currentTwn = LeanTween.colorText(twnData.target.GetComponent <RectTransform>(), twnData.GetValue(__destKey), twnData.time).setEase(twnData.tweenType).setDelay(__delay).setIgnoreTimeScale(twnData.ignoreTimeScale).setOnComplete(() => { twnData.callBack(); }).id; break; case TwnColor.TargetType.tmpComp: // Leantween method _currentTwn = LeanTween.colorTMP_Text(twnData.target.GetComponent <RectTransform>(), twnData.GetValue(__destKey), twnData.time).setEase(twnData.tweenType).setDelay(__delay).setIgnoreTimeScale(twnData.ignoreTimeScale).setOnComplete(() => { twnData.callBack(); }).id; break; default: Debug.LogError("invalid target type"); _isCurrentTwnAvail = false; break; } } catch (Exception e) { Debug.Log(e + " during changing color"); _isCurrentTwnAvail = false; } }
public void UsernameSubmit() { Regex r = new Regex("^[a-zA-Z0-9]*$"); if ((usernameInput.text.Length >= 3 && usernameInput.text.Length <= 12) && r.IsMatch(usernameInput.text)) { HighScores.Instance.CheckUsername(usernameInput.text); usernameLoadingPanel.SetActive(true); usernameEntryPanel.SetActive(false); } else { usernameGuideText.GetComponent <Text>().color = new Color(228f / 255f, 58f / 255f, 47f / 255f); LeanTween.colorText(usernameGuideText, Color.white, 2f).setEaseInSine(); } }
public void ChangeTime(float seconds) { TimeText.text = Utils.SecondsToString((int)seconds); if (seconds <= 10) { if (_timeColorDescr == null) { _timeColorDescr = LeanTween.colorText(TimeText.rectTransform, Color.red, 1f) .setLoopType(LeanTweenType.linear).setLoopCount(-1); } } else { ResetTime(); } }
public void DisplayDescription(string message) { if (!descriptionNotch.gameObject.activeSelf) { descriptionNotch.gameObject.SetActive(true); descriptionText.gameObject.SetActive(true); } if (LeanTween.isTweening(descriptionText)) { LeanTween.cancel(descriptionText); LeanTween.cancel(descriptionNotch); } descriptionText.GetComponent <Text>().text = message; LeanTween.colorText(descriptionText, descriptionColor, tweenInTime).setEase(LeanTweenType.easeOutExpo); LeanTween.color(descriptionNotch, descriptionColor, tweenInTime).setEase(LeanTweenType.easeOutExpo); }
public void OnPointerEnter(PointerEventData eventData) { LeanTween.move(gameObject, startingPosition + new Vector3(50f, 0, 0), tweenInTime).setEase(LeanTweenType.easeOutExpo); LeanTween.colorText(text, textColorSelected, tweenInTime).setEase(LeanTweenType.easeOutExpo); Color fadeInColor = bgPanelSelectedColor; fadeInColor.a = .7f; LeanTween.color(bgPanelSelected, fadeInColor, tweenInTime).setEase(LeanTweenType.easeOutExpo); Color fadeOut = bgPanelColor; fadeOut.a = 0f; LeanTween.color(bgPanel, fadeOut, tweenInTime).setEase(LeanTweenType.easeOutExpo); if (menuManager) { menuManager.DisplayDescription(description); } }
//LeanTween.colorText public static LTDescr LeanColorText(this RectTransform rectTransform, Color to, float time) { return(LeanTween.colorText(rectTransform, to, time)); }
public void HideWarning() { StopWarningColorTween(); _warningColorDescr = LeanTween.colorText(WarningText.rectTransform, WarningFromColor, 0.1f); }
public void OnClicked() { if (!GetGoldScreenController.instance.canTouch) { return; } if (((GetGoldScreen_PanelInstallApp_Controller)GetGoldScreenController.instance.panelInstallApp).timeCanPressGetReward > System.DateTime.Now) { return; } if (appDetail == null) { return; } ((GetGoldScreen_PanelInstallApp_Controller)GetGoldScreenController.instance.panelInstallApp).timeCanPressGetReward = System.DateTime.Now.AddSeconds(0.5f); MyAudioManager.instance.PlaySfx(GameInformation.instance.globalAudioInfo.sfx_Click); if (appDetail.currentState == InstallAppDetail.State.None) { if (!MyConstant.IsAppInstalled(appDetail.packageName)) { string _url = string.Empty; #if UNITY_ANDROID _url = "market://details?id=" + appDetail.packageName; #elif UNITY_IOS //TODO: setup URL cho mở app trên IOS _url = "itms-apps://itunes.apple.com/app/id" + appDetail.packageName; #endif if (!string.IsNullOrEmpty(_url)) { Application.OpenURL(_url); checkAppInstallOrNot = true; } } else { appDetail.StartChecking(); if (appDetail.myOriginalDetail != null) { appDetail.myOriginalDetail.StartChecking(); } RefreshData(); } } else if (appDetail.currentState == InstallAppDetail.State.Checking) { if (!appDetail.CanRecieveReward()) { countDownShakeController.SetUpShakeWorldPoint(0.2f); LeanTween.scale(txtReward_CountDown.gameObject, Vector3.one * 1.1f, 0.2f).setLoopPingPong(1).setEase(LeanTweenType.easeOutBack); LeanTween.colorText(txtReward_CountDown.rectTransform, Color.red, 0.2f).setLoopPingPong(1).setEase(LeanTweenType.easeOutBack); CoreGameManager.instance.DoVibrate(); MyAudioManager.instance.PlaySfx(GetGoldScreenController.instance.sfx_NotThisTime); return; } appDetail.RecieveReward(() => { GetGoldScreenController.instance.RefreshMyGoldInfo(false); if (HomeManager.instance != null && HomeManager.instance.myCallbackManager != null && HomeManager.instance.myCallbackManager.onLoadDataGoldGemFinished != null) { HomeManager.instance.myCallbackManager.onLoadDataGoldGemFinished(); } }, () => { if (panelInstallApp != null) { panelInstallApp.ClearAndCreateNewPanelAppInfo(appDetail); } }); } }
public void HideDescription() { LeanTween.colorText(descriptionText, Color.clear, tweenOutTime); LeanTween.color(descriptionNotch, Color.clear, tweenInTime) .setOnComplete(() => { descriptionText.GetComponent <Text>().text = ""; }); }
void ChangeTextColor(Color color, float delay) { LeanTween.colorText(textcolorRectTransform, color, 2f).setDelay(delay); }
public void DeactivateMsg() { LeanTween.colorText(_warningMsg.rectTransform, _warningMsgColorNoAlpha, 0.1f); }
public override void Draw() { Vector3 scaleTo = new Vector3(1f, 1f, 1f); // Setup Preference Boxes RectTransform optionText01 = optionItemPanel_01.Find("Text_01").GetComponent <RectTransform>(); RectTransform optionText02 = optionItemPanel_02.Find("Text_02").GetComponent <RectTransform>(); RectTransform optionText03 = optionItemPanel_03.Find("Text_03").GetComponent <RectTransform>(); optionText01.GetComponent <Text> ().text = PersistentModel.Instance.GetCustomerPreference(0); optionText02.GetComponent <Text> ().text = PersistentModel.Instance.GetCustomerPreference(1); optionText03.GetComponent <Text> ().text = PersistentModel.Instance.GetCustomerPreference(2); Color optionTextFromColor = new Color(0.5f, 0.5f, 0.5f, 0f); Color optionTextToColor = new Color(50f / 255f, 50f / 255f, 50f / 255f, 1f); // Set option sizes to zero so can scale up in a bit optionItemPanel_01.localScale = Vector3.zero; optionItemPanel_01.GetComponent <Image>().color = elementStartColor; optionText01.GetComponent <Text>().color = optionTextFromColor; optionItemPanel_02.localScale = Vector3.zero; optionItemPanel_02.GetComponent <Image>().color = elementStartColor; optionText02.GetComponent <Text>().color = optionTextFromColor; optionItemPanel_03.localScale = Vector3.zero; optionItemPanel_03.GetComponent <Image>().color = elementStartColor; optionText03.GetComponent <Text>().color = optionTextFromColor; // Start Animations LeanTween.alpha(superTiteSmallLogo, 1f, 0.75f) .setEase(LeanTweenType.easeInOutCubic) .setDelay(0.75f); customerPrefsTitle.localScale = new Vector3(0f, 1f, 1f); customerPrefsTitle.GetComponent <Image>().color = elementStartColor; LeanTween.scale(customerPrefsTitle, new Vector3(1f, 1f, 1f), 0.65f) .setDelay(0.35f) .setEase(LeanTweenType.easeOutBack); popupBg.localScale = new Vector3(0f, 1f, 1f); popupBg.GetComponent <Image>().color = elementStartColor; LeanTween.scale(popupBg, new Vector3(1f, 1f, 1f), 0.65f) .setDelay(0.25f) .setEase(LeanTweenType.easeOutBack) .setOnComplete(() => { }); LeanTween.delayedCall(0.6f, () => { LeanTween.scale(optionsContainer, scaleTo, 0.75f) .setEase(LeanTweenType.easeOutBack) .setDelay(0.1f); // Scale In panels LeanTween.scale(optionItemPanel_01, scaleTo, 0.75f) .setEase(LeanTweenType.easeOutBack) .setDelay(0.2f); LeanTween.scale(optionItemPanel_02, scaleTo, 0.75f) .setEase(LeanTweenType.easeOutBack) .setDelay(0.3f); LeanTween.scale(optionItemPanel_03, scaleTo, 0.75f) .setEase(LeanTweenType.easeOutBack) .setDelay(0.4f); LeanTween.colorText(optionText01, optionTextToColor, 0.75f) .setEase(LeanTweenType.easeOutQuad) .setDelay(0.5f); LeanTween.colorText(optionText02, optionTextToColor, 0.75f) .setEase(LeanTweenType.easeOutQuad) .setDelay(0.55f); LeanTween.colorText(optionText03, optionTextToColor, 0.75f) .setEase(LeanTweenType.easeOutQuad) .setDelay(0.6f) .setOnComplete(() => { // Display got it button LeanTween.alphaCanvas(gotItButton.GetComponent <CanvasGroup>(), 1f, 0.75f); TransitionInCompleted(); // End of Transition }); }); }
public void ActivateMsgWithText(string txt) { _warningMsg.text = txt; LeanTween.colorText(_warningMsg.rectTransform, _warningMsgColorAlpha, 0.25f).setEase(LeanTweenType.easeInOutCubic); }