コード例 #1
0
 public void SetAnimated(bool value)
 {
     //IL_005f: Unknown result type (might be due to invalid IL or missing references)
     if (m_animated == value)
     {
         return;
     }
     if (value)
     {
         s_animatedPointers.Add(this);
         if (!TweenExtensions.IsPlaying(s_animationTween))
         {
             TweenExtensions.Restart(s_animationTween, true, -1f);
         }
     }
     else
     {
         s_animatedPointers.Remove(this);
         if (s_animatedPointers.Count == 0)
         {
             TweenExtensions.Pause <Tweener>(s_animationTween);
         }
         m_spriteRenderer.set_color(Color.get_white());
     }
     m_animated = value;
 }
コード例 #2
0
        public void Highlight(bool highlight)
        {
            //IL_0079: Unknown result type (might be due to invalid IL or missing references)
            if (m_highlighted == highlight || m_previewResource == null || !m_previewResource.highlightEnabled)
            {
                return;
            }
            Tween highlightTweener = m_highlightTweener;

            if (highlightTweener != null && TweenExtensions.IsPlaying(highlightTweener))
            {
                TweenExtensions.Kill(m_highlightTweener, true);
                m_highlightTweener = null;
            }
            if (highlight && m_image != null)
            {
                float highlightPunch = m_previewResource.highlightPunch;
                m_highlightTweener = ShortcutExtensions.DOPunchScale(m_image.get_transform(), new Vector3(highlightPunch, highlightPunch, highlightPunch), m_previewResource.highlightDuration, m_previewResource.highlightVibrato, m_previewResource.highlightElasticity);
                int highlightLoopCount = m_previewResource.highlightLoopCount;
                if (highlightLoopCount != 1)
                {
                    TweenSettingsExtensions.SetLoops <Tween>(m_highlightTweener, highlightLoopCount);
                }
            }
            m_highlighted = highlight;
        }
コード例 #3
0
        protected unsafe override IEnumerator Apply(Sprite sprite, UIResourceDisplayMode displayMode)
        {
            if (null == m_image)
            {
                Log.Warning("No image component has been linked.", 60, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\UI\\Components\\ImageLoader.cs");
                yield break;
            }
            if (m_tween != null)
            {
                TweenExtensions.Kill(m_tween, false);
                m_tween = null;
            }
            if (displayMode == UIResourceDisplayMode.Immediate || !m_image.get_gameObject().get_activeInHierarchy())
            {
                m_alpha = 1f;
                m_image.set_color(m_color);
                m_image.set_sprite(sprite);
                m_image.set_enabled(true);
                yield break;
            }
            Sprite sprite2 = m_image.get_sprite();

            if (null != sprite2)
            {
                float num = m_fadeOutTweenDuration * m_alpha;
                if (num > 0f)
                {
                    m_tween = TweenSettingsExtensions.OnComplete <TweenerCore <float, float, FloatOptions> >(DOTween.To(new DOGetter <float>((object)this, (IntPtr)(void *) /*OpCode not supported: LdFtn*/), new DOSetter <float>((object)this, (IntPtr)(void *) /*OpCode not supported: LdFtn*/), 0f, num), new TweenCallback((object)this, (IntPtr)(void *) /*OpCode not supported: LdFtn*/));
                    while (m_tween != null && TweenExtensions.IsPlaying(m_tween))
                    {
                        yield return(null);
                    }
                }
            }
            else
            {
                Color color = m_color;
                color.a = 0f;
                m_alpha = 0f;
                m_image.set_color(color);
            }
            m_image.set_enabled(true);
            m_image.set_sprite(sprite);
            m_tween = TweenSettingsExtensions.OnComplete <TweenerCore <float, float, FloatOptions> >(DOTween.To(new DOGetter <float>((object)this, (IntPtr)(void *) /*OpCode not supported: LdFtn*/), new DOSetter <float>((object)this, (IntPtr)(void *) /*OpCode not supported: LdFtn*/), 1f, m_fadeInTweenDuration), new TweenCallback((object)this, (IntPtr)(void *) /*OpCode not supported: LdFtn*/));
            while (m_tween != null && TweenExtensions.IsPlaying(m_tween))
            {
                yield return(null);
            }
        }
コード例 #4
0
 public void Hide(Action onFinishedAnimation)
 {
     if (this.mTweenShowHide != null && TweenExtensions.IsPlaying(this.mTweenShowHide))
     {
         TweenExtensions.Kill(this.mTweenShowHide, false);
     }
     this.mTweenShowHide = DOVirtual.Float(this.mPanelThis.alpha, 0f, 0.2f, delegate(float alpha)
     {
         this.mPanelThis.alpha = alpha;
     });
     TweenSettingsExtensions.Join(TweenSettingsExtensions.Append(DOTween.Sequence(), this.mTweenShowHide), ShortcutExtensions.DOScale(base.get_transform(), new Vector3(0.9f, 0.9f), 0.4f));
     if (onFinishedAnimation != null)
     {
         onFinishedAnimation.Invoke();
     }
 }
コード例 #5
0
        public unsafe void TweenZoom(float scrollDelta)
        {
            float num  = Mathf.Sign(scrollDelta) * m_zoomIncrement;
            float num2 = Mathf.Clamp01(m_targetZoomLevel + num);

            if (!(Math.Abs(num2 - m_targetZoomLevel) < float.Epsilon))
            {
                float num3 = Mathf.Lerp(0f, m_zoomTweenDuration, (num2 - m_zoomLevel) / num);
                m_targetZoomLevel = num2;
                if (m_zoomTween != null && TweenExtensions.IsPlaying(m_zoomTween))
                {
                    m_zoomTween.ChangeEndValue((object)num2, num3, true);
                }
                else
                {
                    m_zoomTween = DOTween.To(new DOGetter <float>((object)this, (IntPtr)(void *) /*OpCode not supported: LdFtn*/), new DOSetter <float>((object)this, (IntPtr)(void *) /*OpCode not supported: LdFtn*/), num2, num3);
                }
            }
        }
コード例 #6
0
 public void Show(Action onFinishedanimation)
 {
     this.ChangeFocus(this.mUIPracticeDeckTypeSelectChildrenFocusable[0]);
     if (this.mTweenShowHide != null && TweenExtensions.IsPlaying(this.mTweenShowHide))
     {
         TweenExtensions.Kill(this.mTweenShowHide, false);
     }
     this.mTweenShowHide = TweenSettingsExtensions.OnComplete <Sequence>(TweenSettingsExtensions.Join(TweenSettingsExtensions.Append(DOTween.Sequence(), DOVirtual.Float(this.mPanelThis.alpha, 1f, 0.3f, delegate(float alpha)
     {
         this.mPanelThis.alpha = alpha;
     })), TweenSettingsExtensions.SetEase <Tweener>(DOVirtual.Float(0f, 72f, 0.4f, delegate(float cellHeight)
     {
         this.mGridFocasable.cellHeight = cellHeight;
         this.mGridFocasable.Reposition();
     }), 12)), delegate
     {
         if (onFinishedanimation != null)
         {
             onFinishedanimation.Invoke();
         }
     });
 }
コード例 #7
0
        private unsafe void UpdateTweenedValue(bool tweening = true)
        {
            //IL_00a4: Unknown result type (might be due to invalid IL or missing references)
            int num = GetRealValue() + (m_modificationPreviewValue ?? 0);

            if (num != m_tweenedEndValue)
            {
                m_tweenedEndValue = num;
                if (m_valueTweener != null && TweenExtensions.IsPlaying(m_valueTweener))
                {
                    TweenExtensions.Kill(m_valueTweener, false);
                    m_valueTweener = null;
                }
                if (!tweening || null == m_previewResource)
                {
                    SetTweenedValue(num);
                }
                else
                {
                    m_valueTweener = TweenSettingsExtensions.SetEase <Tweener>(DOTween.To(new DOGetter <int>((object)this, (IntPtr)(void *) /*OpCode not supported: LdFtn*/), new DOSetter <int>((object)this, (IntPtr)(void *) /*OpCode not supported: LdFtn*/), num, m_previewResource.duration), m_previewResource.ease);
                }
            }
        }
コード例 #8
0
ファイル: DeckUI.cs プロジェクト: hussein-aitlahcen/nevaw
        private IEnumerator CloneAnimation(DeckSlot newSlot)
        {
            Sequence sequence2 = DOTween.Sequence();

            TweenSettingsExtensions.Insert(sequence2, 0f, DOTweenModuleUI.DOFade(m_mainCanvasGroup, 0f, 0.2f));
            TweenSettingsExtensions.Insert(sequence2, 0f, m_deck.LeaveEditMode());
            TweenSettingsExtensions.Insert(sequence2, 0f, m_editModeUI.Hide());
            yield return(TweenExtensions.Play <Sequence>(sequence2));

            while (TweenExtensions.IsPlaying(sequence2))
            {
                yield return(null);
            }
            yield return((object)new WaitForTime(0.1f));

            m_selectedSlot = newSlot;
            m_deck.SetValue(m_selectedSlot);
            sequence2 = DOTween.Sequence();
            TweenSettingsExtensions.Append(sequence2, DOTweenModuleUI.DOFade(m_mainCanvasGroup, 1f, 0.2f));
            TweenSettingsExtensions.Append(sequence2, m_deck.EnterEditMode(m_editModeUI.GetCurrentMode()));
            TweenSettingsExtensions.Append(sequence2, m_editModeUI.Display(m_editModeUI.GetCurrentMode(), m_selectedSlot));
            TweenExtensions.Play <Sequence>(sequence2);
            m_deck.OnCloneValidate();
        }
コード例 #9
0
        public unsafe void TweenZoom(float scrollDelta)
        {
            //IL_00a7: Unknown result type (might be due to invalid IL or missing references)
            if (!m_allowInteraction)
            {
                return;
            }
            float num  = Mathf.Sign(scrollDelta) * m_zoomIncrement;
            float num2 = Mathf.Clamp01(m_targetZoomLevel + num);

            if (!(Mathf.Abs(num2 - m_targetZoomLevel) < float.Epsilon))
            {
                float num3 = Mathf.Lerp(0f, m_zoomTweenDuration, (num2 - m_zoomLevel) / num);
                m_targetZoomLevel = num2;
                if (m_zoomTween != null && TweenExtensions.IsPlaying(m_zoomTween))
                {
                    m_zoomTween.ChangeEndValue((object)num2, num3, true);
                }
                else
                {
                    m_zoomTween = TweenSettingsExtensions.SetEase <TweenerCore <float, float, FloatOptions> >(DOTween.To(new DOGetter <float>((object)this, (IntPtr)(void *) /*OpCode not supported: LdFtn*/), new DOSetter <float>((object)this, (IntPtr)(void *) /*OpCode not supported: LdFtn*/), num2, num3), m_zoomEase);
                }
            }
        }
コード例 #10
0
        public unsafe void Pan(Vector2 screenPosition, Vector2 previousScreenPosition)
        {
            //IL_0023: Unknown result type (might be due to invalid IL or missing references)
            //IL_002e: Unknown result type (might be due to invalid IL or missing references)
            //IL_0039: Unknown result type (might be due to invalid IL or missing references)
            //IL_003a: Unknown result type (might be due to invalid IL or missing references)
            //IL_003f: Unknown result type (might be due to invalid IL or missing references)
            //IL_0044: Unknown result type (might be due to invalid IL or missing references)
            //IL_0048: Unknown result type (might be due to invalid IL or missing references)
            //IL_0055: Unknown result type (might be due to invalid IL or missing references)
            //IL_005a: Unknown result type (might be due to invalid IL or missing references)
            //IL_005d: Unknown result type (might be due to invalid IL or missing references)
            //IL_005e: Unknown result type (might be due to invalid IL or missing references)
            //IL_0063: Unknown result type (might be due to invalid IL or missing references)
            //IL_0068: Unknown result type (might be due to invalid IL or missing references)
            //IL_006c: Unknown result type (might be due to invalid IL or missing references)
            //IL_0079: Unknown result type (might be due to invalid IL or missing references)
            //IL_007e: Unknown result type (might be due to invalid IL or missing references)
            //IL_0080: Unknown result type (might be due to invalid IL or missing references)
            //IL_0085: Unknown result type (might be due to invalid IL or missing references)
            //IL_0088: Unknown result type (might be due to invalid IL or missing references)
            //IL_008e: Unknown result type (might be due to invalid IL or missing references)
            //IL_0093: Unknown result type (might be due to invalid IL or missing references)
            //IL_0098: Unknown result type (might be due to invalid IL or missing references)
            //IL_009b: Unknown result type (might be due to invalid IL or missing references)
            //IL_00a0: Unknown result type (might be due to invalid IL or missing references)
            //IL_00a2: Unknown result type (might be due to invalid IL or missing references)
            //IL_00a7: Unknown result type (might be due to invalid IL or missing references)
            //IL_00a9: Unknown result type (might be due to invalid IL or missing references)
            //IL_00ae: Unknown result type (might be due to invalid IL or missing references)
            //IL_00b0: Unknown result type (might be due to invalid IL or missing references)
            //IL_00b8: Unknown result type (might be due to invalid IL or missing references)
            //IL_00ba: Unknown result type (might be due to invalid IL or missing references)
            //IL_00bf: Unknown result type (might be due to invalid IL or missing references)
            //IL_00c4: Unknown result type (might be due to invalid IL or missing references)
            //IL_00c7: Unknown result type (might be due to invalid IL or missing references)
            //IL_00c9: Unknown result type (might be due to invalid IL or missing references)
            //IL_00e9: Unknown result type (might be due to invalid IL or missing references)
            //IL_0117: Unknown result type (might be due to invalid IL or missing references)
            Camera    camera          = this.camera;
            Transform cameraContainer = m_cameraContainer;

            if (!(null == camera) && !(null == cameraContainer))
            {
                Plane val = default(Plane);
                val._002Ector(Vector3.get_up(), m_mapWorldBounds.get_center());
                Ray   val2 = camera.ScreenPointToRay(Vector2.op_Implicit(screenPosition));
                float num  = default(float);
                val.Raycast(val2, ref num);
                Vector3 point = val2.GetPoint(num);
                Ray     val3  = camera.ScreenPointToRay(Vector2.op_Implicit(previousScreenPosition));
                val.Raycast(val3, ref num);
                Vector3 val4     = val3.GetPoint(num) - point;
                Vector3 val5     = cameraContainer.get_rotation() * m_cameraPositionOffset;
                Vector3 position = m_targetCameraPosition + val4 - val5;
                position = (m_targetCameraPosition = val5 + m_cameraWorldRect.ClosestPoint(position));
                if (m_panTween != null && TweenExtensions.IsPlaying(m_panTween))
                {
                    m_panTween.ChangeEndValue((object)position, m_panTweenDuration, true);
                }
                else
                {
                    m_panTween = DOTween.To(new DOGetter <Vector3>((object)this, (IntPtr)(void *) /*OpCode not supported: LdFtn*/), new DOSetter <Vector3>((object)this, (IntPtr)(void *) /*OpCode not supported: LdFtn*/), position, m_panTweenDuration);
                }
            }
        }
コード例 #11
0
        public unsafe IEnumerator FocusOnMapRegion([NotNull] IMapDefinition mapDefinition, int regionIndex, [CanBeNull] CameraControlParameters parameters = null)
        {
            if (m_regionFocusCoroutine != null)
            {
                this.StopCoroutine(m_regionFocusCoroutine);
                m_regionFocusCoroutine = null;
            }
            Camera    camera          = this.camera;
            Transform cameraContainer = m_cameraContainer;

            if (null == camera || null == cameraContainer)
            {
                yield break;
            }
            float panTweenDuration;
            Ease  val;
            float num;
            Ease  val2;

            if (null == parameters)
            {
                CameraControlParameters defaultControlParameters = m_defaultControlParameters;
                if (null == defaultControlParameters)
                {
                    panTweenDuration = m_panTweenDuration;
                    val  = 9;
                    num  = m_zoomTweenDuration;
                    val2 = 9;
                }
                else
                {
                    panTweenDuration = defaultControlParameters.panTweenDuration;
                    val  = defaultControlParameters.panTweenEase;
                    num  = defaultControlParameters.zoomTweenMaxDuration;
                    val2 = defaultControlParameters.zoomTweenEase;
                }
            }
            else
            {
                panTweenDuration = parameters.panTweenDuration;
                val  = parameters.panTweenEase;
                num  = parameters.zoomTweenMaxDuration;
                val2 = parameters.zoomTweenEase;
            }
            FightMapRegionDefinition region = mapDefinition.GetRegion(regionIndex);
            Vector3 val3 = Vector3Int.op_Implicit(mapDefinition.origin);
            Vector2 val4 = Vector2Int.op_Implicit(region.sizeMin);
            Vector2 val5 = Vector2Int.op_Implicit(region.sizeMax);
            Vector3 val6 = cameraContainer.get_rotation() * m_cameraPositionOffset;
            Vector2 val7 = val4 + 0.5f * (val5 - Vector2.get_one() - val4);
            Vector3 targetCameraPosition = new Vector3(((IntPtr)(void *)val7).x, 0f, ((IntPtr)(void *)val7).y) + val3 + val6;
            Vector3 val8 = default(Vector3);

            val8._002Ector(((IntPtr)(void *)val4).x, 0f, ((IntPtr)(void *)val4).y);
            Vector3 val9 = default(Vector3);

            val9._002Ector(((IntPtr)(void *)val5).x, 0f, ((IntPtr)(void *)val5).y);
            Vector3 val10 = default(Vector3);

            val10._002Ector(((IntPtr)(void *)val8).x, 0f, ((IntPtr)(void *)val9).z);
            Vector3 val11 = default(Vector3);

            val11._002Ector(((IntPtr)(void *)val9).x, 0f, ((IntPtr)(void *)val8).z);
            Vector3 val12       = cameraContainer.get_rotation() * new Vector3(1f, 0f, 1f);
            Vector3 normalized  = val12.get_normalized();
            Vector3 normalized2 = val6.get_normalized();

            val12 = val9 - val8;
            float num2 = Mathf.Abs(Vector3.Dot(val12.get_normalized(), normalized));

            val12 = val11 - val10;
            float   num3             = Mathf.Abs(Vector3.Dot(val12.get_normalized(), normalized));
            float   num4             = Mathf.Abs(Vector3.Dot(normalized2, normalized));
            float   num5             = Vector3.Distance(val8, val9);
            float   num6             = Vector3.Distance(val10, val11);
            float   num7             = 2f * val6.get_magnitude();
            Vector2 val13            = 2.828427f * m_regionFocusMargin;
            float   num8             = num2 * num5 + num3 * num6 + num4 * num7 + ((IntPtr)(void *)val13).y;
            float   num9             = (1f - num2) * num5 + (1f - num3) * num6 + (1f - num4) * num7 + ((IntPtr)(void *)val13).x;
            float   num10            = num8 / 4f;
            float   num11            = num9 / 2f / camera.get_aspect();
            float   num12            = Mathf.Max(num10, num11);
            float   targetZoomLevel2 = Mathf.InverseLerp(6f, m_maxOrthoSize, num12);

            targetZoomLevel2       = Mathf.Floor(targetZoomLevel2 / m_zoomIncrement) * m_zoomIncrement;
            m_targetCameraPosition = targetCameraPosition;
            m_targetZoomLevel      = targetZoomLevel2;
            m_userHasControl       = false;
            if (m_panTween != null && TweenExtensions.IsPlaying(m_panTween))
            {
                TweenSettingsExtensions.SetEase <Tweener>(m_panTween.ChangeEndValue((object)targetCameraPosition, panTweenDuration, true), val);
            }
            else
            {
                m_panTween = TweenSettingsExtensions.SetEase <TweenerCore <Vector3, Vector3, VectorOptions> >(DOTween.To(new DOGetter <Vector3>((object)this, (IntPtr)(void *) /*OpCode not supported: LdFtn*/), new DOSetter <Vector3>((object)this, (IntPtr)(void *) /*OpCode not supported: LdFtn*/), targetCameraPosition, panTweenDuration), val);
            }
            float num13 = Mathf.Lerp(0f, num, Mathf.Abs(targetZoomLevel2 - m_zoomLevel) / m_zoomIncrement);

            if (m_zoomTween != null && TweenExtensions.IsPlaying(m_zoomTween))
            {
                TweenSettingsExtensions.SetEase <Tweener>(m_zoomTween.ChangeEndValue((object)targetZoomLevel2, num13, true), val2);
            }
            else
            {
                m_zoomTween = TweenSettingsExtensions.SetEase <TweenerCore <float, float, FloatOptions> >(DOTween.To(new DOGetter <float>((object)this, (IntPtr)(void *) /*OpCode not supported: LdFtn*/), new DOSetter <float>((object)this, (IntPtr)(void *) /*OpCode not supported: LdFtn*/), targetZoomLevel2, num13), val2);
            }
            while (TweenExtensions.IsPlaying(m_panTween) || TweenExtensions.IsPlaying(m_zoomTween))
            {
                yield return(null);

                if (m_targetCameraPosition != targetCameraPosition || m_targetZoomLevel != targetZoomLevel2)
                {
                    break;
                }
            }
            m_regionFocusCoroutine = null;
            m_userHasControl       = true;
        }