Esempio n. 1
0
        private void DoHideBeginAnimation_INTERNAL(System.Action callback, AppearanceParameters parameters)
        {
            if (TweenerGlobal.instance == null)
            {
                return;
            }

            var resetAnimation = parameters.GetResetAnimation(defaultValue: false);
            var immediately    = parameters.GetImmediately(defaultValue: false);
            var delay          = parameters.GetDelay(defaultValue: 0f);

            System.Action callbackInner = () => {
                if (this.animation != null)
                {
                    if (resetAnimation == true)
                    {
                        this.SetResetState();
                    }

                    if (immediately == true)
                    {
                        this.animation.SetOutState(this.animationInputParams, this.GetWindow(), this);
                        callback.Invoke();
                    }
                    else
                    {
                        this.animation.Play(this.GetWindow(), this.animationInputParams, this, false, callback);
                    }
                }
                else
                {
                    callback.Invoke();
                }
            };

            if (TweenerGlobal.instance != null)
            {
                var tag = this.GetTag();
                TweenerGlobal.instance.removeTweens(tag);
                if (immediately == false && delay > 0f)
                {
                    TweenerGlobal.instance.addTween(this, delay, 0f, 0f).tag(tag).onComplete(() => {
                        callbackInner.Invoke();
                    }).onCancel((obj) => {
                        callbackInner.Invoke();
                    });
                }
                else
                {
                    callbackInner.Invoke();
                }
            }
            else
            {
                callbackInner.Invoke();
            }
        }
		private void DoHideBeginAnimation_INTERNAL(System.Action callback, AppearanceParameters parameters) {

			if (TweenerGlobal.instance == null) return;

			var resetAnimation = parameters.GetResetAnimation(defaultValue: false);
			var immediately = parameters.GetImmediately(defaultValue: false);
			var delay = parameters.GetDelay(defaultValue: 0f);

			System.Action callbackInner = () => {
				
				if (this.animation != null) {
					
					if (resetAnimation == true) this.SetResetState();
					
					if (immediately == true) {
						
						this.animation.SetOutState(this.animationInputParams, this.GetWindow(), this);
						callback.Invoke();
						
					} else {
						
						this.animation.Play(this.GetWindow(), this.animationInputParams, this, false, callback);
						
					}
					
				} else {
					
					callback.Invoke();
					
				}

			};

			if (TweenerGlobal.instance != null) {
				
				var tag = this.GetTag();
				TweenerGlobal.instance.removeTweens(tag);
				if (immediately == false && delay > 0f) {

					TweenerGlobal.instance.addTween(this, delay, 0f, 0f).tag(tag).onComplete(() => {

						callbackInner.Invoke();

					}).onCancel((obj) => {
						
						callbackInner.Invoke();

					});

				} else {

					callbackInner.Invoke();

				}

			} else {

				callbackInner.Invoke();

			}

		}