public TweenScaleStrategy(Transform target, ITweenSharedState sharedSharedState, IValueModifier <Vector2> modHandler, ITweenPlayStyleStrategy style) { _target = target; _mod = modHandler; _style = style; _sharedState = (TweenSharedState <Vector2>)sharedSharedState; _state = TweenComponentState.None; _remote = new TweenRemoteControl(); _style.InitializeState(); SubscribeToRemote(); }
public TweenAlphaStrategy(Graphic target, ITweenSharedState sharedState, IValueModifier <float> modHandler, ITweenPlayStyleStrategy style) { _target = target; _mod = modHandler; _style = style; _sharedState = (TweenSharedState <float>)sharedState; _state = TweenComponentState.None; _remote = new TweenRemoteControl(); _style.InitializeState(); SubscribeToRemote(); }
public void UpdateComponent(float deltaTime) { if (CanComplete()) { _sharedState.CycleCount++; if (_style.CanComplete()) { TweenCompleted(); return; } _style.InitializeState(); _mod.Reset(); } _target.localScale = _mod.ModifyValue(deltaTime); _state = TweenComponentState.Processing; }
private void TweenCompleted() { _state = TweenComponentState.Completed; _remote.Complete(); Dispose(); }
private void Kill() { _state = TweenComponentState.Killed; Dispose(); }