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; } }
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(); } } } }
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(); } } } }
public DialogueStepData(GM.DataCache.DialogueInfo steph) { DialogueId = steph.DialogueId; StepId = steph.StepId; Icon = steph.Icon; SpeakName = EB.Localizer.GetTableString(string.Format("ID_guide_dialogue_{0}_{1}_name", steph.DialogueId, steph.StepId), steph.Name); //; Layout = steph.Layout; Context = EB.Localizer.GetTableString(string.Format("ID_guide_dialogue_{0}_{1}_context", steph.DialogueId, steph.StepId), steph.Context); //; Shade = steph.Shade; ShakeTime = (int)steph.CameraShake; StayTime = 600; StepNum = steph.StepNum; FontSize = steph.FontSize; LobbyCamera = SetCameraData(steph.LobbyCamera); }
public LobbyCameraData LobbyCamera; //模型镜头数据 public DialogueStepData() { DialogueId = 0; StepId = 0; Icon = ""; SpeakName = ""; Layout = 0; Context = ""; Shade = 0; ShakeTime = 0; StayTime = 0; StepNum = 0; FontSize = 48; LobbyCamera = null; }
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(); }
private LobbyCameraData SetCameraData(string lobbyCamera) { string cameraParam; if (lobbyCamera != null && lobbyCamera != "") { cameraParam = lobbyCamera; } else { cameraParam = "-0.29,2,0,20.7,5.3,0,0.6,1"; } string[] sArray = cameraParam.Split(','); float[] fArray = LTUIUtil.ToFloat(sArray); Vector3 position = new Vector3(fArray[0], fArray[1], fArray[2]); Vector3 rotation = new Vector3(fArray[3], fArray[4], fArray[5]); float size = fArray[6]; bool orthographic = fArray[7] != 0; Vector3 iconPosition = new Vector3(0, -6, 0); Vector3 iconRot = Vector3.zero; if (fArray.Length > 8) { iconPosition = new Vector3(fArray[8], fArray[9], fArray[10]); iconRot = new Vector3(fArray[11], fArray[12], fArray[13]); } LobbyCameraData lobbyCameraData = new LobbyCameraData { Orthographic = orthographic, Position = position, Rotation = rotation, Size = size, IconPosition = iconPosition, IconRotation = iconRot }; return(lobbyCameraData); }
private LobbyCameraData SetCameraData(string lobbyCamera) { if (lobbyCamera != null) { string[] sArray = lobbyCamera.Split(','); float[] fArray = LTUIUtil.ToFloat(sArray); Vector3 position = new Vector3(fArray[0], fArray[1], fArray[2]); Vector3 rotation = new Vector3(fArray[3], fArray[4], fArray[5]); float size = fArray[6]; bool orthographic = ToBool(fArray[7]); Vector3 iconPosition = new Vector3(0, -6, 0); Vector3 iconRot = Vector3.zero; if (fArray.Length > 8) { iconPosition = new Vector3(fArray[8], fArray[9], fArray[10]); iconRot = new Vector3(fArray[11], fArray[12], fArray[13]); } LobbyCameraData lobbyCameraData = new LobbyCameraData { Orthographic = orthographic, Position = position, Rotation = rotation, Size = size, IconPosition = iconPosition, IconRotation = iconRot }; return(lobbyCameraData); } else { return(new LobbyCameraData { Orthographic = true, Position = Vector3.zero, Rotation = Vector3.zero, Size = 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; }