Esempio n. 1
0
        public DownloadPageContext(bool destroyUntilNotify = false)
        {
            ContextPattern pattern = new ContextPattern {
                contextName    = "DownLoadPageContext",
                viewPrefabPath = "UI/Menus/Page/Loading/DownloadPage"
            };

            base.config = pattern;
            this._destroyUntilNotify = destroyUntilNotify;
            this._sceneGameObjects   = new List <GameObject>();
            BaseMonoCanvas sceneCanvas = Singleton <MainUIManager> .Instance.SceneCanvas;

            this._sceneGameObjects.Add(sceneCanvas.gameObject);
            this._sceneGameObjects.Add(sceneCanvas.GetComponent <Canvas>().worldCamera.gameObject);
        }
Esempio n. 2
0
        public void Update()
        {
            if (this._status == Status.Drag)
            {
                BaseMonoCanvas mainCanvas = Singleton <MainUIManager> .Instance.GetMainCanvas();

                if (mainCanvas != null)
                {
                    float scaleFactor = mainCanvas.GetComponent <Canvas>().scaleFactor;
                    float a           = ((this._targetPos.y - this._beginDragPoint.y) / scaleFactor) - (this.dragObject.anchoredPosition.y - this._beginPoint.y);
                    if (a < 0f)
                    {
                        this.dragSpeed += Time.unscaledDeltaTime * 400f;
                        this.dragSpeed  = Mathf.Min(600f, this.dragSpeed);
                    }
                    else
                    {
                        this.dragSpeed = 0f;
                    }
                    float y = Mathf.Max(a, -this.dragSpeed * Time.unscaledDeltaTime) + this.dragObject.anchoredPosition.y;
                    if (y > 241f)
                    {
                        y = 241f;
                    }
                    this.dragObject.anchoredPosition = new Vector2(this.dragObject.anchoredPosition.x, y);
                    for (int i = 0; i < this._sequenceOffset.Length; i++)
                    {
                        float num5 = (a >= 0f) ? 0f : ((1f - (1f / Mathf.Pow(2f, (float)(i + 1)))) * a);
                        this.dragSequence[i].anchoredPosition = new Vector2(this.dragSequence[i].anchoredPosition.x, this._sequenceOffset[i] + num5);
                    }
                    this.UpdateImageByDelta(y - 241f);
                    if (y <= -59f)
                    {
                        Singleton <NetworkManager> .Instance.RequestIdentifyStigmataAffix(this._item);

                        this._status       = Status.Identify;
                        this._fadeOutTimer = 0f;
                        this.pageTrans.Find("Info/Figure/IdentifySuccEffect").GetComponent <ParticleSystem>().Play();
                        if (!string.IsNullOrEmpty(this.successAudioName))
                        {
                            Singleton <WwiseAudioManager> .Instance.Post(this.successAudioName, null, null, null);
                        }
                    }
                }
            }
            else if (this._status == Status.Identify)
            {
                this._fadeOutTimer += Time.unscaledDeltaTime;
                if (this._fadeOutTimer <= 0.3f)
                {
                    float delta = -Mathf.Lerp(300f, 720f, this._fadeOutTimer / 0.3f);
                    this.dragObject.anchoredPosition = new Vector2(this.dragObject.anchoredPosition.x, 241f + delta);
                    for (int j = 0; j < this._sequenceOffset.Length; j++)
                    {
                        this.dragSequence[j].anchoredPosition = new Vector2(this.dragSequence[j].anchoredPosition.x, this._sequenceOffset[j]);
                    }
                    this.UpdateImageByDelta(delta);
                }
                else if (this._isIdentifySucc)
                {
                    this.Reset();
                    Singleton <NotifyManager> .Instance.FireNotify(new Notify(NotifyTypes.RefreshStigmataDetailView, null));
                }
            }
            else if (this._status == Status.BoundBack)
            {
                this._boundBackTimer += Time.unscaledDeltaTime;
                if (this._boundBackTimer <= 0.2f)
                {
                    float num8 = -Mathf.Lerp(this._boundBackDelta, 0f, this._boundBackTimer / 0.2f);
                    this.dragObject.anchoredPosition = new Vector2(this.dragObject.anchoredPosition.x, 241f + num8);
                    for (int k = 0; k < this._sequenceOffset.Length; k++)
                    {
                        this.dragSequence[k].anchoredPosition = new Vector2(this.dragSequence[k].anchoredPosition.x, this._sequenceOffset[k]);
                    }
                    this.UpdateImageByDelta(num8);
                }
                else
                {
                    this.Reset();
                }
            }
        }