public void LateUpdate() { cellTransform.anchoredPosition = DesiredAnchorPosition(); float bottomOfCell = (cellTransform.anchoredPosition.y) + tableContentTransform.anchoredPosition.y - (tableContentTransform.rect.height - tableTransform.rect.height); Vector2 otherPos = cellTransform.anchoredPosition; float distance = 99999.0f; // Get my sibling's top of cell, allow it to push me out of the way if (nextHeaderTransform != null) { PUTableHeaderScript otherScript = nextHeaderTransform.GetComponent <PUTableHeaderScript> (); otherPos = otherScript.DesiredAnchorPosition(); distance = cellTransform.anchoredPosition.y - otherPos.y; } if (distance < cellTransform.rect.height) { cellTransform.anchoredPosition = new Vector2(otherPos.x, otherPos.y + cellTransform.rect.height); tableCell.puGameObject.canvasGroup.alpha = LeanTween.easeInCubic(0, 1, distance / cellTransform.rect.height); } else if (bottomOfCell < 0) { tableCell.puGameObject.canvasGroup.alpha = LeanTween.easeInCubic(0, 1, (bottomOfCell + cellTransform.rect.height) / cellTransform.rect.height); } else { if (tableCell.puGameObject.canvasGroup.alpha.Equals(1.0f) == false) { tableCell.puGameObject.canvasGroup.alpha = 1.0f; } } }
private IEnumerator FlashAnimation() { for (float t = 0f; t < duration; t += Time.deltaTime) { flash.color = new Color(1f, 1f, 1f, LeanTween.easeInCubic(0f, 1f, t / duration)); yield return(null); } flash.color = new Color(1f, 1f, 1f, 0f); if (showParticles && particles != null) { particles.Play(); } }
public float GetValue(float start, float end, float t) { switch (Easing) { case LeanTweenType.notUsed: return(0f); case LeanTweenType.animationCurve: return(Mathf.Lerp(start, end, AnimationCurve.Evaluate(t))); case LeanTweenType.linear: return(LeanTween.linear(start, end, t)); case LeanTweenType.easeOutQuad: return(LeanTween.easeOutQuad(start, end, t)); case LeanTweenType.easeInQuad: return(LeanTween.easeInQuad(start, end, t)); case LeanTweenType.easeInOutQuad: return(LeanTween.easeInOutQuad(start, end, t)); case LeanTweenType.easeInCubic: return(LeanTween.easeInCubic(start, end, t)); case LeanTweenType.easeOutCubic: return(LeanTween.easeOutCubic(start, end, t)); case LeanTweenType.easeInOutCubic: return(LeanTween.easeInOutCubic(start, end, t)); case LeanTweenType.easeInQuart: return(LeanTween.easeInQuart(start, end, t)); case LeanTweenType.easeOutQuart: return(LeanTween.easeOutQuart(start, end, t)); case LeanTweenType.easeInOutQuart: return(LeanTween.easeInOutQuart(start, end, t)); case LeanTweenType.easeInQuint: return(LeanTween.easeInQuint(start, end, t)); case LeanTweenType.easeOutQuint: return(LeanTween.easeOutQuint(start, end, t)); case LeanTweenType.easeInOutQuint: return(LeanTween.easeInOutQuint(start, end, t)); case LeanTweenType.easeInSine: return(LeanTween.easeInSine(start, end, t)); case LeanTweenType.easeOutSine: return(LeanTween.easeOutSine(start, end, t)); case LeanTweenType.easeInOutSine: return(LeanTween.easeInOutSine(start, end, t)); case LeanTweenType.easeInExpo: return(LeanTween.easeInExpo(start, end, t)); case LeanTweenType.easeOutExpo: return(LeanTween.easeOutExpo(start, end, t)); case LeanTweenType.easeInOutExpo: return(LeanTween.easeInOutExpo(start, end, t)); case LeanTweenType.easeInCirc: return(LeanTween.easeInCirc(start, end, t)); case LeanTweenType.easeOutCirc: return(LeanTween.easeOutCirc(start, end, t)); case LeanTweenType.easeInOutCirc: return(LeanTween.easeInOutCirc(start, end, t)); case LeanTweenType.easeInBounce: return(LeanTween.easeInBounce(start, end, t)); case LeanTweenType.easeOutBounce: return(LeanTween.easeOutBounce(start, end, t)); case LeanTweenType.easeInOutBounce: return(LeanTween.easeInOutBounce(start, end, t)); case LeanTweenType.easeInBack: return(LeanTween.easeInBack(start, end, t)); case LeanTweenType.easeOutBack: return(LeanTween.easeOutBack(start, end, t)); case LeanTweenType.easeInOutBack: return(LeanTween.easeInOutBack(start, end, t)); case LeanTweenType.easeInElastic: return(LeanTween.easeInElastic(start, end, t)); case LeanTweenType.easeOutElastic: return(LeanTween.easeOutElastic(start, end, t)); case LeanTweenType.easeInOutElastic: return(LeanTween.easeInOutElastic(start, end, t)); default: throw new ArgumentOutOfRangeException(); } }
private IEnumerator AnimateFadeMapChange() { RectOpacityContainer[] elements = GetAdventureButtonElements(); float[] audioDelays = new float[3] { 0.16f, 0.2f, 0.15f }; float scale = 2f; for (int j = 0; j != elements.Length; j++) { RectOpacityContainer rectOpacityContainer = elements[j]; rectOpacityContainer.rect.localScale = Vector3.one * scale; if (rectOpacityContainer.text != null) { rectOpacityContainer.text.color = new Color(1f, 1f, 1f, 0f); rectOpacityContainer.text.gameObject.SetActive(value: true); } if (rectOpacityContainer.images != null && rectOpacityContainer.images.Length != 0) { Image[] images = rectOpacityContainer.images; foreach (Image obj in images) { obj.color = new Color(1f, 1f, 1f, 0f); obj.gameObject.SetActive(value: true); } } rectOpacityContainer.rect.gameObject.SetActive(value: true); } int k; for (int i = 0; i != elements.Length; i = k) { RectOpacityContainer ele = elements[i]; float time = 0f; AudioMap.PlayClipAt(AudioMap.instance.logoHit[i], Vector3.zero, AudioMap.instance.uiMixerGroup, audioDelays[i]); for (; time < 0.35f; time += Time.deltaTime) { float num = time / 0.35f; ele.rect.localScale = Vector3.Lerp(Vector3.one * scale, Vector3.one, LeanTween.easeInCubic(0f, 1f, num)); if (ele.text != null) { ele.text.color = new Color(1f, 1f, 1f, Mathf.Lerp(0f, 1f, num)); } if (ele.images != null && ele.images.Length != 0) { Image[] images = ele.images; for (k = 0; k < images.Length; k++) { images[k].color = new Color(1f, 1f, 1f, Mathf.Lerp(0f, 1f, num)); } } yield return(null); } ele.rect.localScale = Vector3.one; cameraShake += new Vector2(UnityEngine.Random.value - 0.5f, UnityEngine.Random.value - 0.5f) * 10f; yield return(new WaitForSeconds(0.1f)); k = i + 1; } }