private BaseTween ProcessTween(BaseTween tween) { tween.SetOnComplete(delegate { tweens.Remove(tween); }); tweens.Add(tween); return(tween); }
private static void AddTweenToPool(BaseTween tween) { if (tween is ValueTween) { valueTweens.Add(tween as ValueTween); } else if (tween is MoveTween) { moveTweens.Add(tween as MoveTween); } else if (tween is Vector2Tween) { vector2Tweens.Add(tween as Vector2Tween); } else if (tween is Vector3Tween) { vector3Tweens.Add(tween as Vector3Tween); } else if (tween is ColorTween) { colorTweens.Add(tween as ColorTween); } else if (tween is QuaternionTween) { quaternionTweens.Add(tween as QuaternionTween); } }
public void CancelTween(BaseTween tween) { if (tween != null) { CancelTween(tween.ID); } }
private BaseTween ProcessTween(BaseTween tween) { tween.SetOnComplete(delegate { m_tweens.Remove(tween); }); m_tweens.Add(tween); EditorApplication.update = EditorUpdate; return(tween); }
private Command GetCommand(PlayMode mode, BaseTween tween) { if (mode == PlayMode.Append) { return(new AppendTweenCommand(tween, this)); } else { return(new JoinTweenCommand(tween, this)); } }
private void PlayTweenInmediatly(BaseTween tween, PlayMode playMode) { tweenList.Add(tween); tween.SetOnComplete(CheckIfSequenceIsComplete); tween.SetOnComplete(() => tween.SetIsPause(true)); if (!ignoreCommands) { commandQueue.Add(GetCommand(playMode, tween)); } }
public void Join(BaseTween tween) { tween.HandleBySequence = true; if (ShouldPlayInmediatly()) { PlayTweenInmediatly(tween, PlayMode.Join); return; } var tweenP = GetPenultimate(); PlayTweenOnComplete(tween, tweenP, PlayMode.Join); }
public void Append(BaseTween tween) { tween.HandleBySequence = true; if (ShouldPlayInmediatly()) { PlayTweenInmediatly(tween, PlayMode.Append); head = tween; return; } PlayTweenOnComplete(tween, head, PlayMode.Append); head = tween; }
private void PlayTweenOnComplete(BaseTween tween, BaseTween previousTween, PlayMode playMode) { tweenList.Add(tween); //pause the tween until it can actually run tween.SetIsPause(true); tween.SetOnComplete(() => tween.SetIsPause(true)); previousTween.SetOnComplete(delegate { RunTween(tween); }); tween.SetOnComplete(CheckIfSequenceIsComplete); if (!ignoreCommands) { commandQueue.Add(GetCommand(playMode, tween)); } }
public BaseTween FillAmountTweenAtSpeed(Image img, float to, float speed) { BaseTween tween = ValueTweenAtSpeed(img.fillAmount, to, speed); tween.SetOnUpdateFloat(delegate(float v) { if (img != null) { img.fillAmount = v; } else { CancelTween(tween); } }); return(tween); }
public void ProcessConnection(BaseTween tween) { List <int> idList; if (tweenConnections.TryGetValue(tween.Owner, out idList)) { if (idList == null) { idList = new List <int>(); } idList.Add(tween.ID); } else { tweenConnections[tween.Owner] = new List <int>() { tween.ID }; } }
private BaseTween ProcessTween(BaseTween tween) { tween.SetOnComplete(() => CancelTween(tween)); return(tween); }
public static void FinishTween(BaseTween tween) { _activeTweens.Remove(tween); AddTweenToPool(tween); }
public static void RemoveTween(BaseTween tween) { _activeTweens.Remove(tween); }
private BaseTween ProcessTween(BaseTween tween) { tween.SetOnComplete(() => tween.IsComplete = true); tween.SetOnComplete(() => tween.Recycle(tween)); return(tween); }
public JoinTweenCommand(BaseTween tween, Sequence sequence) : base(sequence) { this.tween = tween; }
private void RunTween(BaseTween tween) { tween.SetIsPause(false); }
public void RunAtTime(BaseTween tween, float time) { tween.SetIsPause(true); timeEvents.Add(new TimeEvent(delegate { RunTween(tween); }, time)); }