diff --git a/Assets/Content/Prefabs/UI/UIBattle/UIBattle.prefab b/Assets/Content/Prefabs/UI/UIBattle/UIBattle.prefab index db8470590..fba275fd7 100644 --- a/Assets/Content/Prefabs/UI/UIBattle/UIBattle.prefab +++ b/Assets/Content/Prefabs/UI/UIBattle/UIBattle.prefab @@ -1732,9 +1732,9 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 1, y: 1} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: -105, y: 210} - m_SizeDelta: {x: 240, y: 590} - m_Pivot: {x: 0.5, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 280, y: 280} + m_Pivot: {x: 1, y: 1} --- !u!114 &5083753519336987474 MonoBehaviour: m_ObjectHideFlags: 0 @@ -7575,8 +7575,8 @@ RectTransform: m_GameObject: {fileID: 580195797562871363} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 + m_LocalScale: {x: 0.7, y: 0.7, z: 0.7} + m_ConstrainProportionsScale: 1 m_Children: [] m_Father: {fileID: 5213810408001354677} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -10722,11 +10722,11 @@ RectTransform: - {fileID: 5214553398721685030} m_Father: {fileID: 4357504328262671953} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 1} - m_AnchorMax: {x: 0.5, y: 1} - m_AnchoredPosition: {x: 104.8, y: -501} - m_SizeDelta: {x: 269.7, y: 40} - m_Pivot: {x: 1, y: 0.5} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 0} + m_AnchoredPosition: {x: 0, y: -40} + m_SizeDelta: {x: 0, y: 40} + m_Pivot: {x: 0.5, y: 0} --- !u!114 &6148461124210600139 MonoBehaviour: m_ObjectHideFlags: 0 @@ -11557,18 +11557,18 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 + m_ConstrainProportionsScale: 1 m_Children: - {fileID: 3767939599513061667} - {fileID: 5957034194288721546} - {fileID: 1011196657756228559} m_Father: {fileID: 4357504328262671953} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 1} - m_AnchorMax: {x: 0.5, y: 1} - m_AnchoredPosition: {x: 0, y: -236} - m_SizeDelta: {x: 156, y: 156} - m_Pivot: {x: 0.5, y: 1} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -14.5, y: 35.1} + m_SizeDelta: {x: 400, y: 400} + m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &245318573794112969 CanvasRenderer: m_ObjectHideFlags: 0 @@ -18250,10 +18250,10 @@ RectTransform: m_Children: [] m_Father: {fileID: 5213810408001354677} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 400, y: 400} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &1739998026527562663 CanvasRenderer: @@ -37011,15 +37011,15 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 + m_ConstrainProportionsScale: 1 m_Children: [] m_Father: {fileID: 4357504328262671953} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 1} - m_AnchorMax: {x: 0.5, y: 1} - m_AnchoredPosition: {x: -30.1, y: -204} - m_SizeDelta: {x: 280, y: 280} - m_Pivot: {x: 0.5, y: 1} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 5, y: 5} + m_SizeDelta: {x: 10, y: 10} + m_Pivot: {x: 1, y: 1} --- !u!222 &6132386752254044156 CanvasRenderer: m_ObjectHideFlags: 0 diff --git a/Assets/Content/Raw_Art/UI/BattlePage/bg_map_frame.png.meta b/Assets/Content/Raw_Art/UI/BattlePage/bg_map_frame.png.meta index df7c73b31..f737b3473 100644 --- a/Assets/Content/Raw_Art/UI/BattlePage/bg_map_frame.png.meta +++ b/Assets/Content/Raw_Art/UI/BattlePage/bg_map_frame.png.meta @@ -1,132 +1,166 @@ -fileFormatVersion: 2 -guid: f9a64b4be6c198c4ba59db859ac6a68b -TextureImporter: - fileIDToRecycleName: {} - externalObjects: {} - serializedVersion: 9 - mipmaps: - mipMapMode: 0 - enableMipMap: 0 - sRGBTexture: 1 - linearTexture: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapsPreserveCoverage: 0 - alphaTestReferenceValue: 0.5 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: 0.25 - normalMapFilter: 0 - isReadable: 0 - streamingMipmaps: 0 - streamingMipmapsPriority: 0 - grayScaleToAlpha: 0 - generateCubemap: 6 - cubemapConvolution: 0 - seamlessCubemap: 0 - textureFormat: 1 - maxTextureSize: 2048 - textureSettings: - serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 - wrapU: 1 - wrapV: 1 - wrapW: -1 - nPOTScale: 0 - lightmap: 0 - compressionQuality: 50 - spriteMode: 1 - spriteExtrude: 1 - spriteMeshType: 1 - alignment: 0 - spritePivot: {x: 0.5, y: 0.5} - spritePixelsToUnits: 100 - spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spriteGenerateFallbackPhysicsShape: 1 - alphaUsage: 1 - alphaIsTransparency: 1 - spriteTessellationDetail: -1 - textureType: 8 - textureShape: 1 - singleChannelComponent: 0 - maxTextureSizeSet: 0 - compressionQualitySet: 0 - textureFormatSet: 0 - platformSettings: - - serializedVersion: 2 - buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - androidETC2FallbackOverride: 0 - - serializedVersion: 2 - buildTarget: Standalone - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - androidETC2FallbackOverride: 0 - - serializedVersion: 2 - buildTarget: iPhone - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - androidETC2FallbackOverride: 0 - - serializedVersion: 2 - buildTarget: Android - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - androidETC2FallbackOverride: 0 - - serializedVersion: 2 - buildTarget: Windows Store Apps - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - androidETC2FallbackOverride: 0 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - physicsShape: [] - bones: [] - spriteID: 13e052c2a7c44b84286ae02a582a3916 - vertices: [] - indices: - edges: [] - weights: [] - spritePackingTag: BattlePageAtlas - pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: f9a64b4be6c198c4ba59db859ac6a68b +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 4, y: 3, z: 4, w: 3} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 1 + swizzle: 50462976 + cookieLightType: 1 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 13e052c2a7c44b84286ae02a582a3916 + internalID: -2021417472 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Src/GameLogic/Battle/BattleSystemNew.cs b/Assets/Src/GameLogic/Battle/BattleSystemNew.cs index e9a7c5106..17afebeb4 100644 --- a/Assets/Src/GameLogic/Battle/BattleSystemNew.cs +++ b/Assets/Src/GameLogic/Battle/BattleSystemNew.cs @@ -3,6 +3,7 @@ using System.Collections; using System.Collections.Generic; using LuaInterface; using Mono.Xml; +using System.Linq; public class BattleMgr : SingletonMono { @@ -34,7 +35,7 @@ public class BattleMgr : SingletonMono get { return bShowBossIntroEnd; } set { bShowBossIntroEnd = value; } } - + BaseBattle mBattle; public BaseBattle Battle { get { return mBattle; } } @@ -240,7 +241,7 @@ public class BattleMgr : SingletonMono } void Init() - { + { BattleFlyWordMgr.Instance.InitMgr(); mRecordTime2 = Time.realtimeSinceStartup; } @@ -399,7 +400,7 @@ public class BattleMgr : SingletonMono } public void StartVersusBattle(BattleSubMode mode, ActorData[] teamActors, ActorData[] enemyActors, string sceneName, float maxBattlingTime, BattleEndCondition[] endConds, - GvGMark[] OurMarks, GvGMark[] EnemyMarks,bool IsPresspoint,int nPresspoint) + GvGMark[] OurMarks, GvGMark[] EnemyMarks, bool IsPresspoint, int nPresspoint) { mCommonEffectIds.Clear(); if (teamActors == null || enemyActors == null || string.IsNullOrEmpty(sceneName)) return; @@ -412,7 +413,7 @@ public class BattleMgr : SingletonMono conds.AddRange(endConds); ForceSyncSkill(); TowerBattleInfo bi = TowerBattleCfgMgr.Instance.GetTowerBattleInfo(); - mBattle = new VersusBattle(mode, bi, teamActors, enemyActors, sceneName, maxBattlingTime, conds, OurMarks,EnemyMarks,IsPresspoint, nPresspoint); + mBattle = new VersusBattle(mode, bi, teamActors, enemyActors, sceneName, maxBattlingTime, conds, OurMarks, EnemyMarks, IsPresspoint, nPresspoint); mBattle.Start(); SaveBattleStat(); } @@ -480,7 +481,7 @@ public class BattleMgr : SingletonMono public bool StartTimeBattle(LuaTable luaTbl, BattleSubMode mode, float maxFightingTime, string sceneName, string bgmMusic, ActorData[] ourActors, ActorData[] enemyActors, ServerFighterParam[] fighterParams, - BattleEndCondition[] endConds, ValType[] factors,int nRestoreSp, GvGMark[] OurMarks, + BattleEndCondition[] endConds, ValType[] factors, int nRestoreSp, GvGMark[] OurMarks, GvGMark[] EnemyMarks) { if (mode == BattleSubMode.None) return false; @@ -931,7 +932,7 @@ public class BattleMgr : SingletonMono if (BattleCamera.Instance != null) { EnableBattleCamera(); - if(0 < mBattle.FighterMgr.TeamFighters.Count) + if (0 < mBattle.FighterMgr.TeamFighters.Count) BattleCamera.Instance.LockFighter(mBattle.FighterMgr.TeamFighters[0], BattleCamera.Instance.CamCfg.followCamOffset, forward, BattleCamera.Instance.CamCfg.followCameraFov, BattleCamera.Instance.CamCfg.followDist, immediate); } } @@ -1088,8 +1089,8 @@ public class BattleMgr : SingletonMono teamDataDirty = true; if (mInFighting) { - if(bIsForce)// 强制结束战斗 同步属性(巡游战斗中) - { + if (bIsForce)// 强制结束战斗 同步属性(巡游战斗中) + { ForceStopBattle(); ClearBattleLog(); } @@ -1118,13 +1119,13 @@ public class BattleMgr : SingletonMono { int uid = 0; LuaTable ltt = (LuaTable)heroSkills[i]; - int.TryParse(ltt["uid"].ToString(), out uid); + int.TryParse(ltt["uid"].ToString(), out uid); if (uid == 0) continue; - if (ltt["skills"] == null) continue; + if (ltt["skills"] == null) continue; List skillParams = ActorData.ParseSkillParam((LuaTable)ltt["skills"]); dirtySkills.Add(uid, skillParams); - } + } if (mInFighting) { @@ -1144,7 +1145,7 @@ public class BattleMgr : SingletonMono if (skillParams == null) return; bool bIsFind = dirtySkills.ContainsKey(uid); - if(bIsFind) + if (bIsFind) { dirtySkills[uid] = skillParams; } @@ -1331,7 +1332,7 @@ public class BattleMgr : SingletonMono } } } - + public void OnBattleForceStop(bool bossBattle) { if (mBattle.IsNormalBattle) @@ -1339,9 +1340,9 @@ public class BattleMgr : SingletonMono if (mLuaBattleMgr == null) return; mLuaBattleMgr.CallCS2Lua("OnForceBattleFailed", bossBattle, mBattle.IsPlayRecord); } - else if(mBattle.IsTimeBattle) + else if (mBattle.IsTimeBattle) { - mLuaTimeBattleMgr.CallCS2Lua("OnForceBattleFailed"); + mLuaTimeBattleMgr.CallCS2Lua("OnForceBattleFailed"); } } @@ -1396,14 +1397,14 @@ public class BattleMgr : SingletonMono if (f.IsPlayer) { TimeBattle pTimeBattle = mBattle as TimeBattle; - float fRestorSp = 0.0f; - if(null != pTimeBattle) - { + float fRestorSp = 0.0f; + if (null != pTimeBattle) + { fRestorSp = pTimeBattle.GetRestoreSp();//远征之门 战斗胜利后的 回蓝 } float fhpPercent = (f.Life * 1.0f) / f.MaxLife; float fspPercent = f.Sp / f.MaxSp + fRestorSp; - MathUtil.ConverFloatRound(ref fhpPercent); + MathUtil.ConverFloatRound(ref fhpPercent); MathUtil.ConverFloatRound(ref fspPercent); fhpPercent = Mathf.Min(fhpPercent, 1.0f); fspPercent = Mathf.Min(fspPercent, 1.0f); @@ -1415,14 +1416,14 @@ public class BattleMgr : SingletonMono } } - public void OnBattleFailed(bool bossBattle, int bossLife = 0, int bossSp = 0,bool bIsShowFailedUi = true) + public void OnBattleFailed(bool bossBattle, int bossLife = 0, int bossSp = 0, bool bIsShowFailedUi = true) { if (mBattle.IsNormalBattle) { if (mLuaBattleMgr == null) return; - + mLuaBattleMgr.CallCS2Lua("OnBattleFailed", bossBattle, mBattle.IsPlayRecord); - + } else if (mBattle.IsBossBattle) { @@ -1452,13 +1453,13 @@ public class BattleMgr : SingletonMono MathUtil.ConverFloatRound(ref fspPercent);//防止丢之精度 2位后有值 向前进一位 fhpPercent = Mathf.Min(fhpPercent, 1.0f); fspPercent = Mathf.Min(fspPercent, 1.0f); - fighterParams.Add(new ServerFighterParam(f.Actor.ID, 0,0, fhpPercent, fspPercent)); + fighterParams.Add(new ServerFighterParam(f.Actor.ID, 0, 0, fhpPercent, fspPercent)); } } - - mLuaTimeBattleMgr.CallCS2Lua("OnBattleFailed", mBattle.CurBattleField.BattleFrame / Constants.frame_to_time, fighterParams, bossLife, bossSp); - - + + mLuaTimeBattleMgr.CallCS2Lua("OnBattleFailed", mBattle.CurBattleField.BattleFrame / Constants.frame_to_time, fighterParams, bossLife, bossSp); + + } } @@ -1539,7 +1540,7 @@ public class BattleMgr : SingletonMono mLuaBossBattleMgr.CallCS2Lua("OnSyncBossDamage", hurtParam.mHurtVal, mBattle.IsPlayRecord); } } - else if (mBattle.IsTimeBattle &&( mBattle.SubBattleMode == BattleSubMode.Guild || mBattle.SubBattleMode == BattleSubMode.GuildEx) ) + else if (mBattle.IsTimeBattle && (mBattle.SubBattleMode == BattleSubMode.Guild || mBattle.SubBattleMode == BattleSubMode.GuildEx)) { if (mLuaTimeBattleMgr == null) return; UIEventParamFighterHurt hurtParam = ce.Data; @@ -1820,11 +1821,11 @@ public class BattleMgr : SingletonMono } public void ShowPVPPressPoint() - { + { if (mLuaVersusMgr == null) return; - mLuaVersusMgr.CallCS2Lua("OnShowPvpPressPoint"); + mLuaVersusMgr.CallCS2Lua("OnShowPvpPressPoint"); } - + //显示战斗结束转场 public void ShowBattleEndInterlude() { @@ -1853,10 +1854,10 @@ public class BattleMgr : SingletonMono SyncTeamName(); } if (bIsProcessLoad || bRoleModelDirty) //是否需要刷新形象 - { + { NotifyRefreshRoleView(); //刷新形象 CheckRoleModel(); - } + } } public void SyncTeamName() @@ -1874,21 +1875,21 @@ public class BattleMgr : SingletonMono //同步主属性 bool needLoad = false; foreach (var p in dirtySkills) - { + { ActorData ad = ActorDataMgr.Instance.GetActorsById(p.Key); if (ad != null) { needLoad = ad.SkillMgr.SetSkillLevels(p.Value); - ad.ResetFirstSkill(); - } + ad.ResetFirstSkill(); + } } if (null == mBattle) return; //同步战斗属性 if (skillDirty) - { + { foreach (var p in dirtySkills) - { + { Fighter f = mBattle.FighterMgr.GetTeamMemberById(p.Key); if (f != null) { @@ -1929,7 +1930,7 @@ public class BattleMgr : SingletonMono //通知lua 主角转职正式完成 if (mBattle.IsNormalBattle) { - if (mLuaBattleMgr != null) + if (mLuaBattleMgr != null) mLuaBattleMgr.CallCS2Lua("HeroChangeProfessionSuccess"); } else if (mBattle.IsBossBattle) @@ -1979,7 +1980,7 @@ public class BattleMgr : SingletonMono } - + int notifiedStatus = -1; public void NotifyLoadingStatus(int status) { @@ -2037,15 +2038,20 @@ public class BattleMgr : SingletonMono void WorldPos2MinimapPos(Vector3 pos, int mapSizeX, int mapSizeZ, int miniMapSizeX, int miniMapSizeZ, ref float x, ref float z) { + /* float xRate = pos.x / mapSizeX; float zRate = pos.z / mapSizeZ; x = miniMapSizeX * xRate; z = miniMapSizeZ * zRate; + */ + } + public void RefreshMinimap(Vector3 center, int mapSizeX, int mapSizeZ, int miniMapSizeX, int miniMapSizeZ, GameObject hero, params RectTransform[] goes) { - GetFightersPos(); + /* + GetFightersPos(); int cnt = mFightersPos.Count; if (cnt < 2 || goes.Length < 1 || hero == null) return; @@ -2083,6 +2089,54 @@ public class BattleMgr : SingletonMono goes[idx].anchoredPosition = p; } } + */ + + //3d大地图尺寸140*140 + //minimap ui尺寸280*280 + //hero是箭头 + //goes[0]是minimap,其余是怪物 + + Vector3 player_pos = BattleMgr.Instance.Battle.FighterMgr.TeamFighters[0].Position; + Vector3 player_dir = BattleMgr.Instance.Battle.FighterMgr.TeamFighters[0].Forward; + + //更新玩家go在小地图上的对应位置 + RectTransform arrow = hero.gameObject.GetComponent(); + arrow.anchoredPosition = new Vector2(player_pos.x * 2f, player_pos.z * 2f); + +//Debug.Log("player_pos:" + player_pos + " player_dir:" + player_dir); + //Debug.Log("hero.transform.position:" + hero.transform.position); + + // 根据角色朝向更新小地图箭头的旋转 + float angle = Mathf.Atan2(player_dir.x, player_dir.z) * Mathf.Rad2Deg; + arrow.localRotation = Quaternion.Euler(0, 0, -angle); + + + //设置怪物的位置,GetFightersPos获取怪物go,[0]不是怪物 + GetFightersPos(); + int cnt = mFightersPos.Count; + //Debug.Log("cnt:" + cnt); + if (cnt < 2 || goes.Length < 1 || hero == null) return; + + for (int idx = 1; idx < goes.Length; idx++) + { + if (idx + 1 >= cnt) + { + goes[idx].gameObject.SetActive(false); + } + else + { + goes[idx].gameObject.SetActive(true); + Vector3 deltaPos = mFightersPos[idx + 1]; + float enemyX = 0, enemyZ = 0; + //WorldPos2MinimapPos(deltaPos, mapSizeX, mapSizeZ, miniMapSizeX, miniMapSizeZ, ref enemyX, ref enemyZ); + enemyX = deltaPos.x * 2f; + enemyZ = deltaPos.z * 2f; + var p = goes[idx].anchoredPosition; + p.x = enemyX; + p.y = enemyZ; + goes[idx].anchoredPosition = p; + } + } } List mFightersPos = new List(); @@ -2231,7 +2285,7 @@ public class BattleMgr : SingletonMono private bool bHasLoadedRole = false; private bool bLoadingRoleModel = false; - private Dictionary mRoleModelGoDict = new Dictionary(); + private Dictionary mRoleModelGoDict = new Dictionary(); private bool bRoleModelDirty = false; public bool LoadingRoleModel @@ -2241,7 +2295,7 @@ public class BattleMgr : SingletonMono public GameObject GetRoleModelGo(int fighterId) { - if (mRoleModelGoDict == null || mRoleModelGoDict.ContainsKey(fighterId) == false) + if (mRoleModelGoDict == null || mRoleModelGoDict.ContainsKey(fighterId) == false) return null; return mRoleModelGoDict[fighterId]; } @@ -2312,7 +2366,7 @@ public class BattleMgr : SingletonMono { mIsWaittingPlayerStartGame = false; } - + // UIBattleFailed: 等待玩家结束游戏 private bool mIsWaittingPlayerEndGame = false; public bool IsWaittingPlayerEndGame