Пример #1
0
 public TouchAnimationInformation(TouchGUITexture from)
 {
     transitionColor = from.color;
     changeToTexture = from.texture;
     changeToSize = from.transform.localScale.x;
 }
Пример #2
0
        /// <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)); 
        }
Пример #3
0
        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);
        }