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; } }
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(); } } } }
protected void DestroyModel() { if (Lobby != null) { Object.Destroy(Lobby.mDMono.gameObject); } if (Loader != null) { EB.Assets.UnloadAssetByName("UI3DLobby", false); } Lobby = null; Loader = null; ModelName = null; }
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; } } } }
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; }
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 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; }
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; }
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); } }
public override IEnumerator OnRemoveFromStack() { LTPartnerDataManager.Instance.itemNeedCount = 0; m_SpriteIcon.spriteName = string.Empty; StopAllCoroutines(); DestroySelf(); if (Lobby != null) { GameObject.Destroy(Lobby.mDMono.gameObject); Lobby = null; } if (Loader != null) { EB.Assets.UnloadAssetByName("UI3DLobby", false); Loader = null; } if (ModelName != null) { ModelName = null; } yield break; }
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; }
private IEnumerator CreateBuddyModel(UITexture LobbyTexture, string modelName, bool isPlayLight, bool isplayEntry) { isInitLobby = true; if (string.IsNullOrEmpty(modelName)) { isInitLobby = false; yield break; } if (modelName == ModelName) { if (Lobby != null) { if (!Lobby.mDMono.gameObject.activeSelf) { Lobby.mDMono.gameObject.CustomSetActive(true); } Lobby.SetCharMoveState(MoveController.CombatantMoveState.kIdle); yield return(null); LobbyTexture.enabled = true; } isInitLobby = false; if (!isPlayLight) { bloom.thresholdGamma = 1.0f; } yield return(new WaitForSeconds(0.3f)); if (isplayEntry) { Lobby.SetCharMoveState(MoveController.CombatantMoveState.kEntry, true); } yield break; } LobbyTexture.gameObject.CustomSetActive(false); ModelName = modelName; isModelReady = false; UI3DLobby.PreloadWithCallback(modelName, delegate { isModelReady = true; }); if (Lobby == null && Loader == null) { Loader = new GM.AssetLoader <GameObject>("UI3DLobby", controller.gameObject); yield return(Loader); if (Loader.Success) { Loader.Instance.transform.SetParent(LobbyTexture.transform); Lobby = Loader.Instance.GetMonoILRComponent <UI3DLobby>(); Lobby.ConnectorTexture = LobbyTexture; Lobby.CharacterPoolSize = CharacterPoolSize; Camera Camera = Lobby.mDMono.transform.Find("UI3DCamera").GetComponent <Camera>(); Camera.orthographicSize = 2.0f; } } LobbyTexture.gameObject.CustomSetActive(true); while (!isModelReady) { yield return(null); } if (Lobby != null) { if (!Lobby.mDMono.gameObject.activeSelf) { Lobby.mDMono.gameObject.CustomSetActive(true); } Lobby.VariantName = modelName; Lobby.SetCharMoveState(MoveController.CombatantMoveState.kIdle); yield return(null); LobbyTexture.enabled = true; } RenderSettings rs = controller.transform.GetComponentInChildren <RenderSettings>(); if (rs != null) { EB.Debug.Log("rendersetting set : {0}", rs.name); RenderSettingsManager.Instance.SetActiveRenderSettings(rs.name, rs); } else { EB.Debug.LogWarning("rendersetting is null"); } isInitLobby = false; Lobby.SetBloomUITexture(LobbyTexture); bloom = Lobby.BloomCamera.GetComponent <Max820.Bloom>(); while (isPlayLight && bloom.thresholdGamma > 0.15f) { Lobby.BloomCamera.gameObject.CustomSetActive(true); bloom.thresholdGamma = Mathf.Lerp(bloom.thresholdGamma, 0.1f, 0.1f); yield return(new WaitForEndOfFrame()); } if (!isPlayLight) { bloom.thresholdGamma = 1.0f; } yield return(new WaitForSeconds(0.3f)); if (isplayEntry) { Lobby.SetCharMoveState(MoveController.CombatantMoveState.kEntry, true); } }
private IEnumerator CreateBuddyModel(string modelName) { if (string.IsNullOrEmpty(modelName)) { isInitLobby = false; yield break; } if (modelName == ModelName) { if (Lobby != null) { if (!Lobby.mDMono.gameObject.activeSelf) { Lobby.mDMono.gameObject.CustomSetActive(true); } Lobby.SetCharMoveState(MoveController.CombatantMoveState.kIdle); yield return(null); LobbyTexture.enabled = true; Lobby.SetCharMoveState(MoveController.CombatantMoveState.kEntry, true); } isInitLobby = false; yield break; } ModelName = modelName; isModelReady = false; UI3DLobby.PreloadWithCallback(modelName, delegate { isModelReady = true; }); if (Lobby == null && Loader == null) { Loader = new GM.AssetLoader <GameObject>("UI3DLobby", controller.gameObject); yield return(Loader); if (Loader.Success) { Loader.Instance.transform.SetParent(LobbyTexture.transform); Lobby = Loader.Instance.GetMonoILRComponent <UI3DLobby>(); Lobby.ConnectorTexture = LobbyTexture; Lobby.CharacterPoolSize = CharacterPoolSize; Camera Camera = Lobby.mDMono.transform.Find("UI3DCamera").GetComponent <Camera>(); Camera.orthographicSize = 1.25f; } } while (!isModelReady) { yield return(null); } if (Lobby != null) { if (!Lobby.mDMono.gameObject.activeSelf) { Lobby.mDMono.gameObject.CustomSetActive(true); } Lobby.VariantName = modelName; Lobby.SetCharMoveState(MoveController.CombatantMoveState.kIdle); yield return(null); LobbyTexture.enabled = true; Lobby.SetCharMoveState(MoveController.CombatantMoveState.kEntry, true); } isInitLobby = false; }