private Tween GenerateTweenArrow(UIBattleFormationKindSelectManager.Arrow arrow, Direction direction) { int num = 0; UITexture arrowBack = Object.Instantiate <UITexture>(arrow.mTexture_ArrowBack); arrowBack.get_transform().set_parent(arrow.mTexture_ArrowBack.get_transform().get_parent()); arrowBack.get_transform().set_localScale(arrow.mTexture_ArrowBack.get_transform().get_localScale()); arrowBack.get_transform().set_localPosition(arrow.mTexture_ArrowBack.get_transform().get_localPosition()); UITexture arrowFront = Object.Instantiate <UITexture>(arrow.mTexture_ArrowFront); arrowFront.get_transform().set_parent(arrow.mTexture_ArrowFront.get_transform().get_parent()); arrowFront.get_transform().set_localScale(arrow.mTexture_ArrowFront.get_transform().get_localScale()); arrowFront.get_transform().set_localPosition(arrow.mTexture_ArrowFront.get_transform().get_localPosition()); switch (direction + 1) { case Direction.Toggle: num = 20; break; case (Direction)2: num = -20; break; } Sequence sequence = DOTween.Sequence(); Tween tween = ShortcutExtensions.DOLocalMoveX(arrowBack.get_transform(), arrowBack.get_transform().get_localPosition().x + (float)num, this.arrowDuration, false); Tween tween2 = ShortcutExtensions.DOLocalMoveX(arrowFront.get_transform(), arrowFront.get_transform().get_localPosition().x + (float)num, this.arrowDuration, false); Tween tween3 = DOVirtual.Float(arrowBack.alpha, 0f, this.arrowAlpha, delegate(float alpha) { arrowBack.alpha = alpha; arrowFront.alpha = alpha; }); TweenCallback tweenCallback = delegate { Object.Destroy(arrowBack.get_gameObject()); Object.Destroy(arrowFront.get_gameObject()); }; TweenSettingsExtensions.Append(sequence, tween); TweenSettingsExtensions.Join(sequence, tween2); TweenSettingsExtensions.Join(sequence, tween3); TweenSettingsExtensions.OnComplete <Sequence>(sequence, tweenCallback); return(sequence); }
private void OnDestroy() { if (DOTween.IsTweening(this)) { DOTween.Kill(this, false); } this.mArrow_Left = null; this.mArrow_Right = null; this.mUIBattleFormationKindSelector = null; this.mUIDisplaySwipeEventRegion_FormationChange = null; this.mLabel_Formation_Center = null; this.mLabel_Formation_Right = null; this.mLabel_Formation_Left = null; this.mLabel_Formation_Temp = null; this.mWidget_FormationSelecteNames = null; this.mLabelCenter = null; this.mLabelRight = null; this.mLabelLeft = null; this.mLabelTemp = null; this.mUIBattleFormationKindSelectManagerAction = null; }