/// <summary> /// loops through all the Tweens and updates any that are of updateType. If any Tweens are complete /// (the update call will return true) they are removed. /// </summary> private void handleUpdateOfType( GoUpdateType updateType, float deltaTime ) { // loop backwards so we can remove completed tweens for( var i = _tweens.Count - 1; i >= 0; --i ) { var t = _tweens[i]; if( t.state == GoTweenState.Destroyed ) { // destroy method has been called removeTween( t ); } else { // only process tweens with our update type that are running if( t.updateType == updateType && t.state == GoTweenState.Running && t.update( deltaTime * t.timeScale ) ) { // tween is complete if we get here. if destroyed or set to auto remove kill it if( t.state == GoTweenState.Destroyed || t.autoRemoveOnComplete ) { removeTween( t ); t.destroy(); } } } } }
/// <summary> /// sets the update type for the Tween /// </summary> public GoTweenCollectionConfig setUpdateType( GoUpdateType setUpdateType ) { this.propertyUpdateType = setUpdateType; return this; }
/// <summary> /// sets the update type for the Tween /// </summary> public GoTweenConfig setUpdateType( GoUpdateType setUpdateType ) { propertyUpdateType = setUpdateType; return this; }
/// <summary> /// sets the update type for the Tween /// </summary> public GoTweenConfig setUpdateType(GoUpdateType setUpdateType) { propertyUpdateType = setUpdateType; return(this); }
internal static AbstractGoTween updateTypeIs( this AbstractGoTween tween, GoUpdateType updateType ) { tween.updateType = updateType; return tween; }
public GoTweenFlow setUpdateType( GoUpdateType updateType ) { this.updateType = updateType; return this; }
public static GoTween alphaTo(this CanvasGroup self, float duration, float endValue, bool isRelative = false, GoUpdateType goUpdateType = GoUpdateType.Update) { if (duration == 0) { self.alpha = isRelative ? self.alpha + endValue : endValue; return(Go.to(self, 0.0001f, new GoTweenConfig())); } GoTweenConfig gtc = new GoTweenConfig(); gtc.setUpdateType(goUpdateType); gtc.floatProp(() => self.alpha, a => self.alpha = a, endValue, isRelative); return(Go.to(self, duration, gtc)); }