Esempio n. 1
0
        private IEnumerator SetModel(string modelName)
        {
            InputBlockerManager.Instance.Block(InputBlockReason.FUSION_BLOCK_UI_INTERACTION, 0.5f);
            if (string.IsNullOrEmpty(modelName))
            {
                EB.Debug.LogError("LTActivityBodyItem_BossChallenge.SetModel: modelName is null or empty");
                yield break;
            }

            if (_lobbyTex == null)
            {
                _lobbyTex = mDMono.transform.GetComponent <UITexture>("LobbyTexture");
            }

            if (_ui3DLobby == null)
            {
                var Loader = new GM.AssetLoader <GameObject>("UI3DLobby", mDMono.gameObject);
                UI3DLobby.Preload(modelName);
                yield return(Loader);

                if (Loader.Success)
                {
                    Loader.Instance.transform.parent = _lobbyTex.transform;
                    _ui3DLobby = Loader.Instance.GetMonoILRComponent <UI3DLobby>();
                    _ui3DLobby.ConnectorTexture = _lobbyTex;
                    _ui3DLobby.VariantName      = modelName;
                    _ui3DLobby.SetCameraRot(new Vector3(14f, 0f, 0f));

                    switch (_eventType)
                    {
                    case "bosschallenge1":      //地狱三头犬
                        _ui3DLobby.SetCameraMode(4f, true);
                        _ui3DLobby.SetCameraPos(new Vector3(0.3f, 1.4f, -0.5f));
                        break;

                    case "bosschallenge2":      //猛犸巨象
                        _ui3DLobby.SetCameraMode(4.5f, true);
                        _ui3DLobby.SetCameraPos(new Vector3(0.3f, 1.82f, -1.34f));
                        break;

                    case "bosschallenge3":      //死亡镰刀
                        _ui3DLobby.SetCameraMode(5f, true);
                        _ui3DLobby.SetCameraPos(new Vector3(-0.25f, 2.44f, -2.16f));
                        break;
                    }
                }
            }
        }
Esempio n. 2
0
        public IEnumerator CreateRightBuddyModel()
        {
            right_LobbyTexture.uvRect = new Rect(0.0f, 0.0f, 1.0f, 1.0f);
            var             charTpl   = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroInfo(15010);
            LobbyCameraData lobby_cam = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroInfo(charTpl.id).lobby_camera;

            LTUIUtil.SetText(SpeakNameLabel, charTpl.name);
            rightLoader = new GM.AssetLoader <GameObject>("UI3DLobby", controller.gameObject);
            UI3DLobby.Preload(charTpl.model_name);
            yield return(rightLoader);

            if (rightLoader.Success)
            {
                rightLoader.Instance.transform.parent = right_LobbyTexture.transform;
                rightLobby = rightLoader.Instance.GetMonoILRComponent <UI3DLobby>();
            }

            if (rightLobby != null)
            {
                rightLobby.VariantName = charTpl.model_name;

                rightLobby.SetCameraPos(lobby_cam.Position);
                rightLobby.SetCameraRot(lobby_cam.Rotation);
                rightLobby.SetCameraMode(lobby_cam.Size, lobby_cam.Orthographic);

                right_LobbyTexture.transform.GetComponent <TweenPosition>().from.x = -2730;
                right_LobbyTexture.transform.GetComponent <TweenPosition>().to.x   = 0;
                rightLobby.ConnectorTexture = right_LobbyTexture;
            }
        }
Esempio n. 3
0
        public IEnumerator CreateBuddyModel()
        {
            m_LobbyTexture.uvRect = new Rect(0.0f, 0.0f, 1.0f, 1.0f);
            var charTpl  = LTBountyTaskHudController.GetFirstMonsterInfoTpl();
            var heroInfo = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroInfo(charTpl.id);

            ModelName = charTpl.model_name;
            LTUIUtil.SetText(SpeakNameLabel, charTpl.name);
            if (!string.IsNullOrEmpty(heroInfo.portrait))
            {
                m_LobbyTexture.gameObject.CustomSetActive(false);
                m_SpriteIcon.gameObject.CustomSetActive(true);
                m_SpriteIcon.spriteName = heroInfo.portrait;
                m_IsInited = true;
                TweenPosition TP = m_SpriteIcon.transform.GetComponent <TweenPosition>();
                if (TP != null)
                {
                    TP.PlayForward();
                }
            }
            else
            {
                m_SpriteIcon.gameObject.CustomSetActive(false);
                m_LobbyTexture.gameObject.CustomSetActive(true);
                LobbyCameraData lobby_cam = heroInfo.lobby_camera;

                Loader = new GM.AssetLoader <GameObject>("UI3DLobby", controller.gameObject);
                UI3DLobby.Preload(ModelName);
                yield return(Loader);

                if (Loader.Success)
                {
                    Loader.Instance.transform.parent = m_LobbyTexture.transform;
                    Lobby = Loader.Instance.GetMonoILRComponent <UI3DLobby>();
                }

                if (Lobby != null)
                {
                    Lobby.VariantName = ModelName;

                    Lobby.SetCameraPos(lobby_cam.Position);
                    Lobby.SetCameraRot(lobby_cam.Rotation);
                    Lobby.SetCameraMode(lobby_cam.Size, lobby_cam.Orthographic);

                    Lobby.ConnectorTexture = m_LobbyTexture;

                    while (Lobby.Current.character == null)
                    {
                        yield return(null);
                    }
                    m_IsInited = true;
                    TweenPosition TP = m_LobbyTexture.transform.GetComponent <TweenPosition>();
                    if (TP != null)
                    {
                        TP.PlayForward();
                    }
                }
            }
        }
Esempio n. 4
0
        public IEnumerator CreateBuddyModel(Hotfix_LT.Data.HeroInfoTemplate charTpl)
        {
            if (!string.IsNullOrEmpty(charTpl.portrait))
            {
                HeroTex.gameObject.CustomSetActive(false);
                HeroIcon.gameObject.CustomSetActive(true);
                HeroIcon.spriteName = charTpl.portrait;

                TweenPosition TP = HeroIcon.transform.GetComponent <TweenPosition>();
                if (TP != null)
                {
                    TP.ResetToBeginning();
                    TP.PlayForward();
                }
            }
            else
            {
                HeroIcon.gameObject.CustomSetActive(false);
                HeroTex.gameObject.CustomSetActive(true);
                mModelName     = charTpl.model_name;
                HeroTex.uvRect = new Rect(0.0f, 0.0f, 1.0f, 1.0f);
                LobbyCameraData lobby_cam = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroInfo(charTpl.id).lobby_camera;
                Loader = new GM.AssetLoader <GameObject>("UI3DLobby", controller.gameObject);
                UI3DLobby.Preload(mModelName);
                yield return(Loader);

                if (Loader.Success)
                {
                    Loader.Instance.transform.parent = HeroTex.transform;
                    Lobby = Loader.Instance.GetMonoILRComponent <UI3DLobby>();
                }

                if (Lobby != null)
                {
                    Lobby.VariantName = mModelName;

                    Lobby.SetCameraPos(lobby_cam.Position);
                    Lobby.SetCameraRot(lobby_cam.Rotation);
                    Lobby.SetCameraMode(lobby_cam.Size, lobby_cam.Orthographic);

                    Lobby.ConnectorTexture = HeroTex;

                    TweenPosition TP = HeroTex.transform.GetComponent <TweenPosition>();
                    if (TP != null)
                    {
                        TP.ResetToBeginning();
                        TP.PlayForward();
                    }
                }
            }
        }
Esempio n. 5
0
        private IEnumerator LoadBuddy()
        {
            controller.UiTextures["LobbyTexture"].gameObject.CustomSetActive(false);
            string configId = Hotfix_LT.Data.NewGameConfigTemplateManager.Instance.GetGameConfigStrValue("storeModelId");

            if (string.IsNullOrEmpty(configId))
            {
                configId = "10530";
            }
            var             character    = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroInfo(configId);
            string          curModeName  = character.model_name;
            string          configCam    = Hotfix_LT.Data.NewGameConfigTemplateManager.Instance.GetGameConfigStrValue("storeModelCam");
            LobbyCameraData lobby_camera = SetCameraData(configCam);

            if (Lobby == null && Loader == null)
            {
                Loader = new GM.AssetLoader <GameObject>("UI3DLobby", controller.gameObject);
                UI3DLobby.Preload(curModeName);
                yield return(Loader);

                if (Loader.Success)
                {
                    Loader.Instance.transform.parent = controller.UiTextures["LobbyTexture"].transform;
                    Lobby = Loader.Instance.GetMonoILRComponent <UI3DLobby>();
                    Lobby.ConnectorTexture = controller.UiTextures["LobbyTexture"];
                    Lobby.SetCameraPos(lobby_camera.Position);
                    Lobby.SetCameraRot(lobby_camera.Rotation);
                    Lobby.SetCameraMode(lobby_camera.Size, lobby_camera.Orthographic);
                }
            }
            Lobby.mDMono.gameObject.SetActive(true);
            if (Lobby != null)
            {
                Lobby.VariantName = curModeName;
            }
            yield return(null);

            TweenAlpha lobbyTextureAlpha = controller.UiTextures["LobbyTexture"].GetComponent <TweenAlpha>();

            lobbyTextureAlpha.ResetToBeginning();
            controller.UiTextures["LobbyTexture"].gameObject.CustomSetActive(true);
            lobbyTextureAlpha.PlayForward();
        }