public MoveByTweenClip AddLocalMoveBy(GameObject obj, Vector3 amount, float time, EaseType ease, System.Action end = null) { // Check to see if there is a previous MoveBy Clip on this track MoveByTweenClip previous = null; if (mClips.Count > 0 && (mClips[mClips.Count - 1].TweenType == RedTweenType.LocalMoveBy || mClips[mClips.Count - 1].TweenType == RedTweenType.MoveToModifier)) { previous = (MoveByTweenClip)mClips[mClips.Count - 1]; } MoveByTweenClip move = new MoveByTweenClip(this, obj, amount, time, ease, end, previous, false, true); mClips.Add(move); Register(move); return(move); }
public MoveByTweenClip AddMoveToModifier(GameObject obj, Vector3 amount, float time, EaseType ease, System.Action end = null) { // Requires that this be adjusting the position of a move to track that runs on a higher priority. MoveByTweenClip previous = null; // Check to see if there is a previous MoveBy Clip on this track if (mClips.Count > 0 && (mClips[mClips.Count - 1].TweenType == RedTweenType.MoveBy || mClips[mClips.Count - 1].TweenType == RedTweenType.MoveToModifier)) { previous = (MoveByTweenClip)mClips[mClips.Count - 1]; } MoveByTweenClip move = new MoveByTweenClip(this, obj, amount, time, ease, end, previous, true, false); mClips.Add(move); Register(move); return(move); }
public MoveByTweenClip(RedTween.Track track, GameObject obj, Vector3 amount, float time, EaseType ease, System.Action end, MoveByTweenClip previousClip, bool moveToMod, bool local) { if (obj == null) { // Object is null there is nothing to move. return; } mType = (local)? RedTweenType.LocalMoveBy : ((previousClip == null)? RedTweenType.MoveBy : RedTweenType.MoveToModifier); mLocal = local; mTrans = obj.transform; mAmount = amount; mTime = time; mEndAction = end; mFunction = Easing.EaseFunction(ease); mPreviousClip = previousClip; mMoveToModefier = moveToMod; mTrack = track; if (mFunction != null) { mInitialized = true; } }