public bool setType(int type) { if (type != this.type) { AMUtil.recordObject(this, "set type"); this.type = type; return(true); } return(false); }
public bool setStill(bool still) { if (still != this.still) { AMUtil.recordObject(this, "set still"); this.still = still; return(true); } return(false); }
public bool setUseSendMessage(bool useSendMessage) { if (this.useSendMessage != useSendMessage) { AMUtil.recordObject(this, "set sendMsg"); this.useSendMessage = useSendMessage; return(true); } return(false); }
public bool setColor(Color color) { if (color != this.color) { AMUtil.recordObject(this, "set color"); this.color = color; return(true); } return(false); }
public bool setValue(Vector2 vect2) { if (this.vect2 != vect2) { AMUtil.recordObject(this, "set value"); this.vect2 = vect2; return(true); } return(false); }
public bool setTarget(Transform target) { if (target != this.target) { AMUtil.recordObject(this, "set orient target"); this.target = target; return(true); } return(false); }
public bool setValue(Rect rect) { if (this.rect != rect) { AMUtil.recordObject(this, "set value"); this.rect = rect; return(true); } return(false); }
public bool setValue(Color color) { if (this.color != color) { AMUtil.recordObject(this, "set value"); this.color = color; return(true); } return(false); }
public bool setValue(Vector3 vect3) { if (this.vect3 != vect3) { AMUtil.recordObject(this, "set value"); this.vect3 = vect3; return(true); } return(false); }
public bool setCameraFadeType(int cameraFadeType) { if (cameraFadeType != this.cameraFadeType) { AMUtil.recordObject(this, "set camera fade type"); this.cameraFadeType = cameraFadeType; return(true); } return(false); }
public int interp = 0; // interpolation public bool setInterpolation(int _interp) { if (_interp != interp) { AMUtil.recordObject(this, "change interpolation"); interp = _interp; return(true); } return(false); }
public bool setValue(string val) { if (this.str != val) { AMUtil.recordObject(this, "set value"); this.str = val; return(true); } return(false); }
public bool setAmClip(AnimationClip clip) { if (amClip != clip) { AMUtil.recordObject(this, "set animation clip"); amClip = clip; return(true); } return(false); }
public bool setVector4(Vector4 val_vect4) { if (this.val_vect4 != val_vect4) { AMUtil.recordObject(this, "set evt param"); this.val_vect4 = val_vect4; return(true); } return(false); }
public bool setCrossFade(bool crossfade) { if (this.crossfade != crossfade) { AMUtil.recordObject(this, "set crossFade"); this.crossfade = crossfade; return(true); } return(false); }
public bool setPosition(Vector3 position) { if (position != this.position) { AMUtil.recordObject(this, "change position"); this.position = position; return(true); } return(false); }
public bool setWrapMode(WrapMode wrapMode) { if (this.wrapMode != wrapMode) { AMUtil.recordObject(this, "set wrap mode"); this.wrapMode = wrapMode; return(true); } return(false); }
public bool setValue(float val) { if (this.val != (double)val) { AMUtil.recordObject(this, "set value"); this.val = (double)val; return(true); } return(false); }
public bool setCrossfadeTime(float crossfadeTime) { if (this.crossfadeTime != crossfadeTime) { AMUtil.recordObject(this, "set fade time"); this.crossfadeTime = crossfadeTime; return(true); } return(false); }
public bool setRotationQuaternion(Vector4 rotation) { Quaternion q = new Quaternion(rotation.x, rotation.y, rotation.z, rotation.w); if (this.rotation != q) { AMUtil.recordObject(this, "set rotation"); this.rotation = q; return(true); } return(false); }
private void destroy_nonUndo() { // destroy keys foreach (AMKey key in keys) { key.destroy(); } // destroy cache destroyCache(); // destroy track //Object.DestroyImmediate(this); AMUtil.destroyObjImm(this); }
private void deleteAllKeys_undo() { AMUtil.recordObject(this, "destroy keys"); var copyKeys = keys; keys = new List <AMKey>(); foreach (var k in copyKeys) { k.destroy(); } // destroy cache destroyCache(); }
public void updateOrientationCache(AMTake curTake, bool restoreRotation = false) { AMUtil.recordObject(this, "update cache"); // save rotation Quaternion temp = obj.rotation; // sort keys sortKeys(); destroyCache(); cache = new List <AMAction>(); AMTranslationTrack translationTrack = curTake.getTranslationTrackForTransform(obj); for (int i = 0; i < keys.Count; i++) { // create new action and add it to cache list AMOrientationAction a = ScriptableObject.CreateInstance <AMOrientationAction> (); a.startFrame = keys[i].frame; if (keys.Count > (i + 1)) { a.endFrame = keys[i + 1].frame; } else { a.endFrame = -1; } a.obj = obj; // targets a.startTarget = (keys[i] as AMOrientationKey).target; if (a.endFrame != -1) { a.endTarget = (keys[i + 1] as AMOrientationKey).target; } a.easeType = (keys[i] as AMOrientationKey).easeType; a.customEase = new List <float>(keys[i].customEase); if (translationTrack != null && !a.isLookFollow()) { a.isSetStartPosition = true; a.startPosition = translationTrack.getPositionAtFrame(a.startFrame); a.isSetEndPosition = true; a.endPosition = translationTrack.getPositionAtFrame(a.endFrame); } // add to cache cache.Add(a); } // restore rotation if (restoreRotation) { obj.rotation = temp; } }
public void deleteKeyOnFrame(int frame) { for (int i = 0; i < keys.Count; i++) { var k = keys[i]; if (k.frame == frame) { AMUtil.recordObject(this, "delete key on frame"); keys.RemoveAt(i); k.destroy(); --i; } } }
public void offsetKeysFromBy(int frame, int amount) { if (keys.Count <= 0) { return; } for (int i = 0; i < keys.Count; i++) { if (frame <= 0 || keys[i].frame >= frame) { AMUtil.recordObject(keys[i], "update key"); keys[i].frame += amount; } } updateCache(); }
void processSelectProperty(Component propertyComponent, FieldInfo fieldInfo, PropertyInfo propertyInfo, MethodInfo methodMegaMorphSetPercent = null) { if (!aData || !track) { this.Close(); } bool changePropertyValue = true; if ((track.keys.Count > 0) && (!EditorUtility.DisplayDialog("Data Will Be Lost", "You will lose all of the keyframes on track '" + track.name + "' if you continue.", "Continue Anway", "Cancel"))) { changePropertyValue = false; } if (changePropertyValue) { //AMTimeline.registerUndo("Set Property"); AMUtil.recordObject(this, "set property"); // delete keys if (track.keys.Count > 0) { track.deleteAllKeys(); AMCodeView.refresh(); } // set fieldinfo or propertyinfo if (fieldInfo != null) { track.setFieldInfo(fieldInfo); } else if (propertyInfo != null) { track.setPropertyInfo(propertyInfo); } // MegaMorph else if (methodMegaMorphSetPercent != null) { track.setMethodInfo(methodMegaMorphSetPercent, new string[] { "System.Int32", "System.Single" }, AMPropertyTrack.ValueType.MorphChannels); } // set component track.setComponent(propertyComponent); track.updateCache(); } this.Close(); }
public bool setEaseType(int easeType) { if (easeType != this.easeType) { AMUtil.recordObject(this, "set ease type"); this.easeType = easeType; if (easeType == 32 && customEase.Count <= 0) { // set up default custom ease with linear customEase = new List <float>() { 0f, 0f, 1f, 1f, 1f, 1f, 1f, 1f }; } return(true); } return(false); }
// add a new key public void addKey(int _frame, Camera camera = null, /*int? type = null, Camera camera = null, Color? color = null,*/ AMCameraSwitcherKey keyToClone = null) { foreach (AMCameraSwitcherKey key in keys) { // if key exists on frame, update key if (key.frame == _frame) { if (camera != null) { AMUtil.recordObject(key, "update key"); key.camera = camera; key.type = 0; updateCache(); } return; } } AMUtil.recordObject(this, "add key"); AMCameraSwitcherKey a = ScriptableObject.CreateInstance <AMCameraSwitcherKey>(); if (keyToClone) { a = (AMCameraSwitcherKey)keyToClone.CreateClone(); } else { a.type = 0; a.still = !AMTake.isProLicense; a.easeType = (int)AMTween.EaseType.easeOutSine; } a.frame = _frame; if (camera != null) { a.camera = camera; a.type = 0; } // add a new key keys.Add(a); // update cache updateCache(); }
public override void updateCache() { AMUtil.recordObject(this, "update cache"); // destroy cache destroyCache(); // create new cache cache = new List <AMAction>(); // sort keys sortKeys(); // add all clips to list for (int i = 0; i < keys.Count; i++) { AMAudioAction a = ScriptableObject.CreateInstance <AMAudioAction> (); a.startFrame = keys[i].frame; a.audioSource = audioSource; a.audioClip = (keys[i] as AMAudioKey).audioClip; a.loop = (keys[i] as AMAudioKey).loop; cache.Add(a); } base.updateCache(); }
private void _destroyCache_undo() { #if UNITY_EDITOR if (cache == null) { return; } AMUtil.recordObject(this, "destroy cache"); var copyCache = cache; cache = null; foreach (AMAction action in copyCache) { if (action == null) { continue; } action.destroy(); } #endif }