Пример #1
0
        public static void EnableUIAvatarsDynamicBone(bool enabled)
        {
            GlobalVars.UI_AVATAR_USE_DYNAMIC_BONE = enabled;
            BaseMonoCanvas sceneCanvas = Singleton <MainUIManager> .Instance.SceneCanvas;

            if ((sceneCanvas != null) && (((sceneCanvas is MonoMainCanvas) || (sceneCanvas is MonoTestUI)) || (sceneCanvas is MonoGameEntry)))
            {
                Avatar3dModelContext context;
                if (sceneCanvas is MonoMainCanvas)
                {
                    context = ((MonoMainCanvas)sceneCanvas).avatar3dModelContext;
                }
                else if (sceneCanvas is MonoTestUI)
                {
                    context = ((MonoTestUI)sceneCanvas).avatar3dModelContext;
                }
                else
                {
                    context = ((MonoGameEntry)sceneCanvas).avatar3dModelContext;
                }
                if (context != null)
                {
                    foreach (Transform transform in context.GetAllAvatars())
                    {
                        foreach (DynamicBone bone in transform.gameObject.GetComponentsInChildren <DynamicBone>(true))
                        {
                            bone.enabled = enabled;
                        }
                    }
                }
            }
        }
Пример #2
0
        public void LateUpdate()
        {
            Vector3 one = Vector3.one;

            if (!string.IsNullOrEmpty(this.FollowTargetUIPath))
            {
                BaseMonoCanvas sceneCanvas = Singleton <MainUIManager> .Instance.SceneCanvas;
                if (sceneCanvas == null)
                {
                    return;
                }
                one = sceneCanvas.transform.FindChild(this.FollowTargetUIPath).position;
            }
            else if (this.UseParentUIPos)
            {
                Transform parent = base.transform.parent;
                if ((parent != null) && (parent.gameObject.layer == LayerMask.NameToLayer("UI")))
                {
                    one = parent.position;
                }
            }
            else
            {
                one = this._initPosition;
            }
            Camera cameraComponent = Singleton <CameraManager> .Instance.GetMainCamera().cameraComponent;

            Vector3 position = Singleton <CameraManager> .Instance.GetInLevelUICamera().gameObject.GetComponent <Camera>().WorldToScreenPoint(one);

            position.z = this.depthInMainCamera;
            base._effect.gameObject.transform.position = cameraComponent.ScreenToWorldPoint(position);
        }
Пример #3
0
        private void OnCgIconButtonClicked(CgDataItem data)
        {
            BaseMonoCanvas mainCanvas = Singleton <MainUIManager> .Instance.GetMainCanvas();

            if (mainCanvas is MonoMainCanvas)
            {
                (mainCanvas as MonoMainCanvas).PlayVideo(data);
            }
        }
Пример #4
0
        private void OnVideoEnd(CgDataItem cgDataItem)
        {
            BaseMonoCanvas mainCanvas = Singleton <MainUIManager> .Instance.GetMainCanvas();

            if (mainCanvas != null)
            {
                MonoMainCanvas canvas2 = mainCanvas as MonoMainCanvas;
                if (canvas2 != null)
                {
                    this.SetStarEffectActive(true);
                }
            }
        }
Пример #5
0
        public void SetupView(AvatarDataItem avatarDataItem)
        {
            this._avatarDataItem = avatarDataItem;
            BaseMonoCanvas sceneCanvas = Singleton <MainUIManager> .Instance.SceneCanvas;

            if (sceneCanvas is MonoMainCanvas)
            {
                this._avatarModel = ((MonoMainCanvas)sceneCanvas).avatar3dModelContext.GetAvatarById(this._avatarDataItem.avatarID);
            }
            else
            {
                this._avatarModel = ((MonoTestUI)sceneCanvas).avatar3dModelContext.GetAvatarById(this._avatarDataItem.avatarID);
            }
        }
Пример #6
0
        private void SetupMeiHairFade(string tabName)
        {
            BaseMonoCanvas sceneCanvas = Singleton <MainUIManager> .Instance.SceneCanvas;

            if (sceneCanvas is MonoMainCanvas)
            {
                this._avatarModel = ((MonoMainCanvas)sceneCanvas).avatar3dModelContext.GetAvatarById(this.userData.leaderAvatar.avatarID);
            }
            else
            {
                this._avatarModel = ((MonoTestUI)sceneCanvas).avatar3dModelContext.GetAvatarById(this.userData.leaderAvatar.avatarID);
            }
            this.SetMeiHairFade(tabName);
        }
Пример #7
0
        public static bool ContainsUIAvatar(int avatarID)
        {
            BaseMonoCanvas sceneCanvas = Singleton <MainUIManager> .Instance.SceneCanvas;

            if (sceneCanvas is MonoMainCanvas)
            {
                return(((MonoMainCanvas)sceneCanvas).avatar3dModelContext.ContainUIAvatar(avatarID));
            }
            if (sceneCanvas is MonoTestUI)
            {
                return(((MonoTestUI)sceneCanvas).avatar3dModelContext.ContainUIAvatar(avatarID));
            }
            return(((MonoGameEntry)sceneCanvas).avatar3dModelContext.ContainUIAvatar(avatarID));
        }
Пример #8
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);
        }
Пример #9
0
        public override void Destroy()
        {
            base.Destroy();
            BaseMonoCanvas mainCanvas = Singleton <MainUIManager> .Instance.GetMainCanvas();

            if (mainCanvas != null)
            {
                MonoMainCanvas canvas2 = mainCanvas as MonoMainCanvas;
                if (canvas2 != null)
                {
                    MonoVideoPlayer videoPlayer = canvas2.VideoPlayer;
                    videoPlayer.OnVideoEnd = (Action <CgDataItem>)Delegate.Remove(videoPlayer.OnVideoEnd, new Action <CgDataItem>(this.OnVideoBegin));
                    MonoVideoPlayer player2 = canvas2.VideoPlayer;
                    player2.OnVideoEnd = (Action <CgDataItem>)Delegate.Remove(player2.OnVideoEnd, new Action <CgDataItem>(this.OnVideoEnd));
                }
            }
        }
Пример #10
0
        public static BaseMonoUIAvatar GetUIAvatar(int avatarID)
        {
            Transform      avatarById;
            BaseMonoCanvas sceneCanvas = Singleton <MainUIManager> .Instance.SceneCanvas;

            if (sceneCanvas is MonoMainCanvas)
            {
                avatarById = ((MonoMainCanvas)sceneCanvas).avatar3dModelContext.GetAvatarById(avatarID);
            }
            else if (sceneCanvas is MonoTestUI)
            {
                avatarById = ((MonoTestUI)sceneCanvas).avatar3dModelContext.GetAvatarById(avatarID);
            }
            else
            {
                avatarById = ((MonoGameEntry)sceneCanvas).avatar3dModelContext.GetAvatarById(avatarID);
            }
            if (avatarById == null)
            {
                return(null);
            }
            return(avatarById.GetComponent <BaseMonoUIAvatar>());
        }
Пример #11
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();
                }
            }
        }