Ejemplo n.º 1
0
        public void VerifyAnimations(TouchGUIBase touchGUIBaseOld)
        {
            if (unlatchedAnimationTop == null)
                unlatchedAnimationTop = new TouchAnimationInformation();
            unlatchedAnimationTop.Verify(touchGUIBaseOld);

            if (unlatchedAnimationBase == null)
                unlatchedAnimationBase = new TouchAnimationInformation();
            unlatchedAnimationBase.Verify(touchGUIBaseOld);

            if (latchedAnimationTop == null)
                latchedAnimationTop = new TouchAnimationInformation();
            latchedAnimationTop.Verify(touchGUIBaseOld);

            if (latchedAnimationBase == null)
                latchedAnimationBase = new TouchAnimationInformation();
            latchedAnimationBase.Verify(touchGUIBaseOld);
        }
        private bool GUI_EditPanel_Animation_DoAnimationInfoEditor(TouchAnimationInformation t)
        {
            bool dirty = false;
            Texture oldTex = t.changeToTexture;
            oldTex = EditorGUILayout.ObjectField(oldTex,typeof(Texture),false,GUILayout.Height(_selectedTouchBase.selectedMiscPanel._width/3)) as Texture;
            if(oldTex != t.changeToTexture)
            {
                t.changeToTexture = oldTex;
                dirty = true;
            }
		
            GUILayout.BeginHorizontal();
			
            
            float oldSize = Mathf.Clamp01( EditorGUILayout.FloatField(t.changeToSize));
            if(oldSize != t.changeToSize)
            {
                t.changeToSize = oldSize;
                dirty = true;
            }
			
            GUILayout.EndHorizontal();
		
            GUILayout.BeginHorizontal();
			
            
            Color oldColor = EditorGUILayout.ColorField(t.transitionColor);
            if(oldColor != t.transitionColor)
            {
                t.transitionColor = oldColor;
                dirty = true;
            }
			
            GUILayout.EndHorizontal();
		
            GUILayout.Space(5);
		
		
            TouchAnimationInformation.TransitionMethod newR = (TouchAnimationInformation.TransitionMethod)EditorGUILayout.EnumPopup(t.transitionMethod);
            if(newR != t.transitionMethod)
            {
                t.transitionMethod = newR;
                if(t.transitionMethod != TouchAnimationInformation.TransitionMethod.Smooth)
                    t.transitionMethodValue = 0;
			 
                dirty = true;
            }
            GUI.enabled =t.transitionMethod == TouchAnimationInformation.TransitionMethod.Smooth;
            GUILayout.BeginHorizontal();
            GUILayout.Label("Speed: ",EditorStyles.miniLabel);
            float oldSpeed = Mathf.Clamp01(EditorGUILayout.FloatField(t.transitionMethodValue));
            GUILayout.EndHorizontal();
            if(oldSpeed != t.transitionMethodValue)
            {
                t.transitionMethodValue = oldSpeed;
                dirty = true;
            }
            GUI.enabled  = true;
		
		
            return dirty;
        }
Ejemplo n.º 3
0
        private TouchAnimationPresetSnapshot LerpAnimationSnapshotInformation(TouchAnimationPresetSnapshot target, TouchAnimationInformation to, float t)
        {
            target.color = Color.Lerp(target.color, to.transitionColor, t);

            target.texture = to.changeToTexture;

            target.size = Mathf.Lerp(target.size, to.changeToSize, t);

            return target;
        }
Ejemplo n.º 4
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);
        }