public TouchAnimationInformation(TouchGUITexture from) { transitionColor = from.color; changeToTexture = from.texture; changeToSize = from.transform.localScale.x; }
/// <summary> /// Sets GUI element scale /// </summary> public static void RescalePart(TouchGUITexture toScale, float scaleTo) { if (toScale.texture == null) return; toScale.transform.localScale = new Vector2(scaleTo, scaleTo / ((float)toScale.texture.width / (float)toScale.texture.height)); }
private void LerpAnimationInformation(TouchGUITexture target, TouchAnimationInformation from, TouchAnimationInformation to, float t) { target.color = Color.Lerp(from.transitionColor, to.transitionColor, t); target.texture = to.changeToTexture; float newSize = Mathf.Lerp(from.changeToSize, to.changeToSize, t); TouchGUIBase.RescalePart(target, newSize); }