Beispiel #1
0
        private IEnumerator CreateBuddyModel(string modelName)
        {
            if (string.IsNullOrEmpty(modelName) || ModelName == modelName)
            {
                yield break;
            }

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

                if (Loader.Success)
                {
                    Loader.Instance.transform.parent = LobbyTexture.transform;
                    Lobby = Loader.Instance.GetMonoILRComponent <UI3DLobby>();
                    Lobby.ConnectorTexture = LobbyTexture;
                    Lobby.SetCameraMode(2, true);
                }
            }

            if (Lobby != null)
            {
                Lobby.VariantName = ModelName;
            }
        }
Beispiel #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;
            }
        }
Beispiel #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();
                    }
                }
            }
        }
Beispiel #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();
                    }
                }
            }
        }
Beispiel #5
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;
                    }
                }
            }
        }
Beispiel #6
0
        private IEnumerator CreateBuddyModel(string modelName)
        {
            CreateModelFx.CustomSetActive(false);
            yield return(new WaitForEndOfFrame());

            yield return(null);

            CreateModelFx.CustomSetActive(true);
            if (mTweenAlpha == null)
            {
                if (LobbyTexture == null)
                {
                    yield break;
                }
                mTweenAlpha = LobbyTexture.GetComponent <TweenAlpha>();
            }
            mTweenAlpha.ResetToBeginning();
            mTweenAlpha.PlayForward();
            if (string.IsNullOrEmpty(modelName) || ModelName == modelName)
            {
                yield break;
            }
            ModelName = modelName;
            if (Lobby == null && Loader == null)
            {
                Loader = new GM.AssetLoader <GameObject>("UI3DLobby", controller.gameObject);

                UI3DLobby.Preload(ModelName);
                yield return(Loader);

                if (Loader.Success)
                {
                    Loader.Instance.transform.parent = LobbyTexture.transform;
                    Lobby = Loader.Instance.GetMonoILRComponent <UI3DLobby>();
                    Lobby.ConnectorTexture = LobbyTexture;
                    Lobby.SetCameraMode(2, true);
                }
            }

            if (Lobby != null)
            {
                Lobby.VariantName = ModelName;
            }
            yield break;
        }
Beispiel #7
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();
        }
Beispiel #8
0
        private IEnumerator CreateBossModel(string modelName)
        {
            isInitLobby = true;
            if (string.IsNullOrEmpty(modelName))
            {
                isInitLobby = false;
                yield break;
            }

            if (modelName == ModelName)
            {
                isInitLobby = false;
                yield break;
            }

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

                if (Loader.Success)
                {
                    Loader.Instance.transform.parent = LobbyTexture.transform;
                    Lobby = Loader.Instance.GetMonoILRComponent <UI3DLobby>();
                    Lobby.ConnectorTexture  = LobbyTexture;
                    Lobby.CharacterPoolSize = CharacterPoolSize;
                    Camera Camera = Lobby.mDMono.transform.Find("UI3DCamera").GetComponent <Camera>();
                    Camera.orthographicSize = 4.2f;
                }
            }

            if (Lobby != null)
            {
                Lobby.VariantName = modelName;
                yield return(null);

                Lobby.SetCharMoveState(MoveController.CombatantMoveState.kEntry, true);
            }
            isInitLobby = false;
        }
Beispiel #9
0
        private IEnumerator CreateGod()
        {
            string modelName = "P027-Variant";

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

                if (Loader.Success)
                {
                    Loader.Instance.transform.parent = LobbyTexture.transform;
                    Lobby = Loader.Instance.GetMonoILRComponent <UI3DLobby>();
                    Lobby.ConnectorTexture = LobbyTexture;
                    Lobby.SetCameraMode(1, true);
                    Lobby.VariantName = modelName;
                }
            }
            TextureTween.PlayForward();
            isInitLobby = false;
        }
Beispiel #10
0
        private IEnumerator CreateMonster(string modelName)
        {
            if (string.IsNullOrEmpty(modelName))
            {
                yield break;
            }

            if (modelName == ModelName)
            {
                yield break;
            }

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

                if (Loader.Success)
                {
                    Loader.Instance.transform.parent = mMonsterTex.transform;
                    Lobby = Loader.Instance.GetMonoILRComponent <UI3DLobby>();
                    Lobby.ConnectorTexture  = mMonsterTex;
                    Lobby.CharacterPoolSize = CharacterPoolSize;
                    Lobby.SetCameraMode(1.5f, true);
                }
            }

            if (Lobby != null)
            {
                Lobby.VariantName = modelName;
                while (Lobby.Current == null || Lobby.Current.character == null)
                {
                    yield return(null);
                }
                Lobby.SetCharMoveState(MoveController.CombatantMoveState.kReady);
            }
        }
Beispiel #11
0
        public IEnumerator CreateBuddyModel(int layout, DialogueStepData data)
        {
            string ShowPortraitSprite = null;//是否是显示半身像,否则显示模型

            lobbyTexture.uvRect = new Rect(0.0f, 0.0f, 1.0f, 1.0f);

            if (data != null)
            {
                int characterId = Convert.ToInt32(data.Icon);
                var charTpl     = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroInfo(characterId);

                if (charTpl == null)
                {
                    EB.Debug.LogError("No Character for id = {0}", characterId);
                    yield break;
                }

                if (!string.IsNullOrEmpty(charTpl.portrait))
                {
                    ShowPortraitSprite = charTpl.portrait;
                }

                if (charTpl.model_name == DialoguePlayUtil.Instance.ModelName && layout == DialoguePlayUtil.Instance.Layout)
                {
                    yield break;
                }

                DialoguePlayUtil.Instance.ModelName = charTpl.model_name;
            }
            else
            {
                yield break;
            }

            ContextBg.gameObject.CustomSetActive(false);

            if (ShowPortraitSprite != null)//显示半身像
            {
                lobbyTexture.gameObject.CustomSetActive(false);
                m_SpriteIcon.gameObject.CustomSetActive(true);
                DialoguePlayUtil.Instance.Layout = layout;
                m_SpriteIcon.spriteName          = ShowPortraitSprite;
            }
            else//显示模型
            {
                m_SpriteIcon.gameObject.CustomSetActive(false);
                lobbyTexture.gameObject.CustomSetActive(true);
                DialoguePlayUtil.Instance.Layout = layout;
                Vector3 charLightDirection = Quaternion.Euler(dialogueLightRotate) * Vector3.forward;
                Shader.SetGlobalVector("_CharTopDirectionToLight0", Vector3.zero - charLightDirection.normalized);

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

                    if (DialoguePlayUtil.Instance.Loader.Instance != null)
                    {
                        DialoguePlayUtil.Instance.Loader.Instance.transform.SetParent(mDMono.transform.parent);
                    }

                    if (DialoguePlayUtil.Instance.Loader.Success)
                    {
                        DialoguePlayUtil.Instance.Lobby = DialoguePlayUtil.Instance.Loader.Instance.GetMonoILRComponent <UI3DLobby>();
                        DialoguePlayUtil.Instance.Lobby.CharacterPoolSize = CharacterPoolSize;

                        if (DialoguePlayUtil.Instance.repaceTopShader != null)
                        {
                            DialoguePlayUtil.Instance.Lobby.renderSettings.gameObject.CustomSetActive(false);
                            DialoguePlayUtil.Instance.Lobby.lobbyCamera.SetReplacementShader(DialoguePlayUtil.Instance.repaceTopShader, "RenderType");
                            Shader.SetGlobalFloat("_CharTopOutlineScale", DialoguePlayUtil.Instance.dialogueOutlineScale);
                        }
                    }
                    else
                    {
                        EB.Debug.LogError("DialoguePlayUtil.Instance.Loader Load Fail!");
                        EB.Assets.UnloadAssetByName("UI3DLobby", false);

                        if (DialoguePlayUtil.Instance.Loader.Instance != null)
                        {
                            UnityEngine.Object.Destroy(DialoguePlayUtil.Instance.Loader.Instance.gameObject);
                        }

                        DialoguePlayUtil.Instance.Loader = null;
                    }

                    DialoguePlayUtil.Instance.IsLobbyLoadOk = true;
                }

                if (DialoguePlayUtil.Instance.Lobby != null)
                {
                    DialoguePlayUtil.Instance.Lobby.ConnectorTexture = lobbyTexture;
                    DialoguePlayUtil.Instance.Lobby.mDMono.transform.SetChildLayer(LayerMask.NameToLayer("UI3D"));
                    DialoguePlayUtil.Instance.Lobby.VariantName = DialoguePlayUtil.Instance.ModelName;

                    LobbyCameraData cameraData = null;
                    cameraData = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroInfo(data.Icon).lobby_camera;

                    if (cameraData != null)
                    {
                        DialoguePlayUtil.Instance.Lobby.SetCameraPos(cameraData.Position);
                        DialoguePlayUtil.Instance.Lobby.SetCameraRot(cameraData.Rotation);
                        DialoguePlayUtil.Instance.Lobby.SetCameraMode(cameraData.Size, cameraData.Orthographic);
                    }
                    else
                    {
                        EB.Debug.LogError("CreateBuddyModel: lobby_camera = null");
                    }

                    Vector3 iconRotation = lobbyTexture.transform.eulerAngles;

                    if ((eDialogueLayout)layout == eDialogueLayout.Left)
                    {
                        lobbyTexture.transform.GetComponent <TweenPosition>().from.x = -2730;
                        lobbyTexture.transform.GetComponent <TweenPosition>().to.x   = 0;
                        lobbyTexture.transform.localPosition    = cameraData.IconPosition;
                        lobbyTexture.transform.localEulerAngles = cameraData.IconRotation;
                    }
                    else if ((eDialogueLayout)layout == eDialogueLayout.Right)
                    {
                        lobbyTexture.transform.GetComponent <TweenPosition>().from.x = 2730;
                        lobbyTexture.transform.GetComponent <TweenPosition>().to.x   = 0;
                        iconRotation.y = 180;
                        lobbyTexture.transform.localRotation = Quaternion.Euler(iconRotation);
                    }
                }
            }

            ContextBg.gameObject.CustomSetActive(true);
            DialoguePlayUtil.Instance.ShowContext = true;
        }