Beispiel #1
0
 public AMActionFieldSet(AMKey key, int frameRate, object target, FieldInfo f, object val)
     : base(key, frameRate)
 {
     mObj = target;
     mField = f;
     mVal = val;
 }
 public static void setValues(AMKey _key, AMTrack _track)
 {
     justSet = true;
     key = _key;
     track = _track;
     //aData = _aData;
     selectedIndex = key.easeType;
 }
Beispiel #3
0
 // copy properties from key
 public override void CopyTo(AMKey key)
 {
     AMTriggerKey a = key as AMTriggerKey;
     a.enabled = false;
     a.frame = frame;
     a.valueString = valueString;
     a.valueInt = valueInt;
     a.valueFloat = valueFloat;
 }
 // copy properties from key
 public override void CopyTo(AMKey key)
 {
     AMAnimationKey a = key as AMAnimationKey;
     a.enabled = false;
     a.frame = frame;
     a.wrapMode = wrapMode;
     a.amClip = amClip;
     a.crossfade = crossfade;
 }
Beispiel #5
0
 // copy properties from key
 public override void CopyTo(AMKey key)
 {
     AMAudioKey a = key as AMAudioKey;
     a.enabled = false;
     a.frame = frame;
     a.audioClip = audioClip;
     a.loop = loop;
     a.oneShot = oneShot;
 }
 // copy properties from key
 public override void CopyTo(AMKey key)
 {
     AMRotationEulerKey a = key as AMRotationEulerKey;
     a.enabled = false;
     a.frame = frame;
     a.rotation = rotation;
     a.easeType = easeType;
     a.customEase = new List<float>(customEase);
 }
 public override void CopyTo(AMKey key)
 {
     AMOrientationKey a = key as AMOrientationKey;
     a.enabled = false;
     a.frame = frame;
     a.target = target;
     a.targetPath = targetPath;
     a.easeType = easeType;
     a.customEase = new List<float>(customEase);
 }
 public override void CopyTo(AMKey key)
 {
     AMCameraSwitcherKey a = key as AMCameraSwitcherKey;
     a.type = type;
     a._camera = _camera;
     a._cameraPath = _cameraPath;
     a.color = color;
     a.cameraFadeType = cameraFadeType;
     a.cameraFadeParameters = new List<float>(cameraFadeParameters);
     a.irisShape = irisShape;
     a.still = still;
 }
Beispiel #9
0
 /*public bool setParameters(object[] parameters) {
     if(this.parameters != parameters) {
         this.parameters = parameters;
         return true;
     }
     return false;
 }*/
 // copy properties from key
 public override void CopyTo(AMKey key)
 {
     AMEventKey a = key as AMEventKey;
     a.enabled = false;
     a.frame = frame;
     a.component = component;
     a.componentName = componentName;
     a.useSendMessage = useSendMessage;
     // parameters
     a.methodName = methodName;
     a.cachedMethodInfo = cachedMethodInfo;
     foreach(AMEventParameter e in parameters) {
         a.parameters.Add(e.CreateClone());
     }
 }
 public void reloadAnimatorData()
 {
     aData = null;
     loadAnimatorData();
     AMTake take = aData.getCurrentTake();
     // update references for track and key
     bool shouldClose = true;
     foreach(AMTrack _track in take.trackValues) {
         if(track ==	_track) {
             track = _track;
             foreach(AMKey _key in track.keys) {
                 if(key == _key) {
                     key = _key;
                     shouldClose = false;
                 }
             }
         }
     }
     if(shouldClose) this.Close();
 }
Beispiel #11
0
 public void Insert(AMKey key, Tweener tween)
 {
     mSequence.Insert(key.getWaitTime(mTake.frameRate, 0.0f), tween);
 }
Beispiel #12
0
 public AMActionGOActive(AMKey key, int frameRate, GameObject target, bool val)
     : base(key, frameRate)
 {
     mGO = target;
     mVal = val;
 }
Beispiel #13
0
 void OnAutoKey(AMTrack track, AMKey key)
 {
     if(key != null) {
         Undo.RegisterCreatedObjectUndo(key, "Auto Key");
     }
 }
Beispiel #14
0
 public AMActionTransLocalRotEulerZ(AMKey key, int frameRate, Transform target, float val)
     : base(key, frameRate, target, val)
 {
 }
Beispiel #15
0
 public AMActionTransLocalRotEulerVal(AMKey key, int frameRate, Transform target, float val)
     : base(key, frameRate)
 {
     mTrans = target;
     mVal = val;
 }
Beispiel #16
0
 public AMActionMaterialTexOfsSet(AMKey key, int frameRate, Material mat, string prop, Vector2 ofs)
     : base(key, frameRate, mat, prop)
 {
     mOfs = ofs;
 }
Beispiel #17
0
 public AMActionMaterialFloatSet(AMKey key, int frameRate, Material mat, string prop, float val)
     : base(key, frameRate, mat, prop)
 {
     mVal = val;
 }
Beispiel #18
0
 public AMActionData(AMKey key, int frameRate)
 {
     mStartTime = key.getWaitTime(frameRate, 0.0f);
     mEndTime = mStartTime + ((float)key.getNumberOfFrames(frameRate))/((float)frameRate);
 }
Beispiel #19
0
 public AMActionSpriteSet(AMKey key, int frameRate, SpriteRenderer target, Sprite spr)
     : base(key, frameRate)
 {
     mSpriteRender = target;
     mSprite = spr;
 }
Beispiel #20
0
 public AMActionPropertySet(AMKey key, int frameRate, object target, PropertyInfo prop, object val)
     : base(key, frameRate)
 {
     mObj = target;
     mProp = prop;
     mVal = val;
 }
Beispiel #21
0
 public AMActionMaterialVectorSet(AMKey key, int frameRate, Material mat, string prop, Vector4 val)
     : base(key, frameRate, mat, prop)
 {
     mVal = val;
 }
Beispiel #22
0
 public AMActionMaterialTexSet(AMKey key, int frameRate, Material mat, string prop, Texture tex)
     : base(key, frameRate, mat, prop)
 {
     mTex = tex;
 }
Beispiel #23
0
 public AMActionMaterialTexScaleSet(AMKey key, int frameRate, Material mat, string prop, Vector2 s)
     : base(key, frameRate, mat, prop)
 {
     mScale = s;
 }
 void OnDisable()
 {
     window = null;
     justSet = false;
     key = null;
     track = null;
     aData = null;
 }
Beispiel #25
0
 public AMActionMaterial(AMKey key, int frameRate, Material mat, string prop)
     : base(key, frameRate)
 {
     mMat = mat;
     mPropId = Shader.PropertyToID(prop);
 }
Beispiel #26
0
 public AMActionMaterialPropName(AMKey key, int frameRate, Material mat, string prop)
     : base(key, frameRate)
 {
     mMat = mat;
     mProp = prop;
 }
Beispiel #27
0
 public AMActionTransLocalRot(AMKey key, int frameRate, Transform target, Quaternion rot)
     : base(key, frameRate)
 {
     mTrans = target;
     mRot = rot;
 }
Beispiel #28
0
 public AMActionTransLocalRotEuler(AMKey key, int frameRate, Transform target, Vector3 rot)
     : base(key, frameRate)
 {
     mTrans = target;
     mRot = rot;
 }
Beispiel #29
0
 public AMActionTransLocalPos(AMKey key, int frameRate, Transform target, Vector3 pos)
     : base(key, frameRate)
 {
     mTrans = target;
     mPos = pos;
 }
Beispiel #30
0
    public static bool showEasePicker(AMTrack track, AMKey key, AnimatorData aData, float x = -1f, float y = -1f, float width = -1f)
    {
        bool didUpdate = false;
        if(x >= 0f && y >= 0f && width >= 0f) {
            width--;
            float height = 22f;
            Rect rectLabel = new Rect(x, y - 1f, 40f, height);
            GUI.Label(rectLabel, "Ease");
            Rect rectPopup = new Rect(rectLabel.x + rectLabel.width + 2f, y + 3f, width - rectLabel.width - width_button_delete - 3f, height);

            int nease = EditorGUI.Popup(rectPopup, key.easeType, easeTypeNames);
            if(key.easeType != nease) {
                recordUndoTrackAndKeys(track, false, "Change Ease");
                key.setEaseType(nease);
                // update cache when modifying varaibles
                track.updateCache();
                AMCodeView.refresh();
                // preview new position
                aData.getCurrentTake().previewFrame(aData.getCurrentTake().selectedFrame);
                // save data
                EditorUtility.SetDirty(track);
                setDirtyKeys(track);
                // refresh component
                didUpdate = true;
                // refresh values
                AMEasePicker.refreshValues();
            }

            Rect rectButton = new Rect(width - width_button_delete + 1f, y, width_button_delete, width_button_delete);
            if(GUI.Button(rectButton, getSkinTextureStyleState("popup").background, GUI.skin.GetStyle("ButtonImage"))) {
                AMEasePicker.setValues(/*aData,*/key, track);
                EditorWindow.GetWindow(typeof(AMEasePicker));
            }

            //display specific variable for certain tweens
            //TODO: only show this for specific tweens
            if(!key.hasCustomEase()) {
                y += rectButton.height + 4;
                Rect rectAmp = new Rect(x, y, 200f, height);
                key.amplitude = EditorGUI.FloatField(rectAmp, "Amplitude", key.amplitude);

                y += rectAmp.height + 4;
                Rect rectPer = new Rect(x, y, 200f, height);
                key.period = EditorGUI.FloatField(rectPer, "Period", key.period);
            }
        }
        else {
            GUILayout.BeginHorizontal();
            GUILayout.BeginVertical();
            GUILayout.Space(1f);
            GUILayout.Label("Ease");
            GUILayout.EndVertical();
            GUILayout.BeginVertical();
            GUILayout.Space(3f);
            int nease = EditorGUILayout.Popup(key.easeType, easeTypeNames);
            if(key.easeType != nease) {
                recordUndoTrackAndKeys(track, false, "Change Ease");
                key.setEaseType(nease);
                // update cache when modifying varaibles
                track.updateCache();
                AMCodeView.refresh();
                // preview new position
                aData.getCurrentTake().previewFrame(aData.getCurrentTake().selectedFrame);
                // save data
                EditorUtility.SetDirty(track);
                setDirtyKeys(track);
                // refresh component
                didUpdate = true;
                // refresh values
                AMEasePicker.refreshValues();
            }
            GUILayout.EndVertical();
            if(GUILayout.Button(getSkinTextureStyleState("popup").background, GUI.skin.GetStyle("ButtonImage"), GUILayout.Width(width_button_delete), GUILayout.Height(width_button_delete))) {
                AMEasePicker.setValues(/*aData,*/key, track);
                EditorWindow.GetWindow(typeof(AMEasePicker));
            }
            GUILayout.Space(1f);
            GUILayout.EndHorizontal();

            //display specific variable for certain tweens
            //TODO: only show this for specific tweens
            if(!key.hasCustomEase()) {
                key.amplitude = EditorGUILayout.FloatField("Amplitude", key.amplitude);

                key.period = EditorGUILayout.FloatField("Period", key.period);
            }
        }
        return didUpdate;
    }