Assets/Resources/UI/Endless/SkillTitle.meta
New file @@ -0,0 +1,8 @@ fileFormatVersion: 2 guid: 83f03c8585bda6042b382981b1b95968 folderAsset: yes DefaultImporter: externalObjects: {} userData: assetBundleName: assetBundleVariant: Assets/Resources/UI/Endless/SkillTitle/2.pngAssets/Resources/UI/Endless/SkillTitle/2.png.meta
Assets/Resources/UI/Endless/SkillTitle/3.png
Assets/Resources/UI/Endless/SkillTitle/3.png.meta
New file @@ -0,0 +1,118 @@ fileFormatVersion: 2 guid: af3089b3910c84646a24f960ecdd84dd TextureImporter: internalIDToNameTable: [] externalObjects: {} serializedVersion: 11 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 vTOnly: 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 ignorePngGamma: 0 applyGammaDecoding: 0 platformSettings: - serializedVersion: 3 buildTarget: DefaultTexturePlatform maxTextureSize: 2048 resizeAlgorithm: 0 textureFormat: -1 textureCompression: 1 compressionQuality: 50 crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 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 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - serializedVersion: 3 buildTarget: Android maxTextureSize: 2048 resizeAlgorithm: 0 textureFormat: 4 textureCompression: 1 compressionQuality: 50 crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 1 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 sprites: [] outline: [] physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 internalID: 0 vertices: [] indices: edges: [] weights: [] secondaryTextures: [] spritePackingTag: pSDRemoveMatte: 0 pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: Assets/Scripts/Core/Health/Damageable.cs
@@ -28,6 +28,10 @@ // 当前的Entity用于响应各种血量相关的事件。 public event Action<HealthChangeInfo> damaged, healed, died, healthChanged; /// <summary> /// 魔法护盾值改变 /// </summary> public event Action<HealthChangeInfo> ShieldWallHealthChanged; /// <summary> /// Gets the current health. @@ -38,6 +42,31 @@ /// 设置无敌状态. /// </summary> public bool bInvincible { get; set; } /// <summary> /// 是否存在魔法护盾 /// </summary> public bool IsExistShieldWall { get; set; } /// <summary> /// 0 -> 和agent的生命周期一致,直到死亡, > 0 (单位s)*时间内生效 /// </summary> public float ShieldWallEffectiveTime { get; set; } /// <summary> /// 魔法护盾生效剩余时间,这个只针对 ShieldWallEffectTime > 0 才生效 /// </summary> public float ShieldWallRemainTime { get; set; } /// <summary> /// 魔法护盾最大生命值,即初始生命值 /// </summary> public float ShieldWallMaxHealth { get; set; } /// <summary> /// 魔法护盾当前生命值,当 <= 0时直接移除护盾效果 /// </summary> public float ShieldWallCurrentHealth { get; set; } /// <summary> /// Gets the normalised health. @@ -53,6 +82,18 @@ } return currentHealth / maxHealth; } } /// <summary> /// 清理魔法护盾 /// </summary> public void ClearShieldWall() { IsExistShieldWall = false; ShieldWallMaxHealth = 0; ShieldWallCurrentHealth = 0; ShieldWallRemainTime = 0; ShieldWallEffectiveTime = 0; } /// <summary> @@ -141,6 +182,36 @@ } /// <summary> /// 获得一个魔法护盾 /// </summary> /// <param name="maxHealth">护盾的最大生命值</param> /// <param name="effectiveTime">生效时间 0 -> 和Agent生命周期一致,> 0 *(单位ms)时间内生效</param> public void AddShieldWall(float maxHealth, float effectiveTime) { // 如果重复获得护盾,直接全部重置数据,移除之前的护盾效果,重新获得一个护盾 IsExistShieldWall = true; ShieldWallEffectiveTime = effectiveTime; if (effectiveTime > 0) ShieldWallRemainTime = effectiveTime / 1000f; ShieldWallMaxHealth = ShieldWallCurrentHealth = maxHealth; HealthChangeInfo info = new HealthChangeInfo { damageable = this, ShieldWallMaxHealth = maxHealth, ShieldWallCurrentHealth = maxHealth, IsExistShieldWall = true }; if (ShieldWallHealthChanged != null) { ShieldWallHealthChanged(info); } } /// <summary> /// Use the alignment to see if taking damage is a valid action /// </summary> /// <param name="damage"> @@ -214,8 +285,32 @@ /// <param name="info">HealthChangeInfo for this change</param> protected void ChangeHealth(float healthIncrement, ref HealthChangeInfo info) { bool changeHealth = false; float increment = healthIncrement; if (IsExistShieldWall) { info.ShieldWallOldHealth = ShieldWallCurrentHealth; ShieldWallCurrentHealth += healthIncrement; if (ShieldWallCurrentHealth == 0) info.IsExistShieldWall = IsExistShieldWall = false; else if (ShieldWallCurrentHealth < 0) { changeHealth = true; info.IsExistShieldWall = IsExistShieldWall = false; // 护盾血量不够减 increment = ShieldWallCurrentHealth; info.ShieldWallCurrentHealth = ShieldWallCurrentHealth = 0; } } else changeHealth = true; if (changeHealth) { info.oldHealth = currentHealth; currentHealth += healthIncrement; currentHealth += increment; currentHealth = Mathf.Clamp(currentHealth, 0f, maxHealth); info.newHealth = currentHealth; @@ -224,6 +319,7 @@ healthChanged(info); } } } /// <summary> /// A helper method for null checking actions Assets/Scripts/Core/Health/DamageableBehaviour.cs
@@ -54,7 +54,6 @@ /// </summary> public event Action<DamageableBehaviour> died; /// <summary> /// Takes the damage and also provides a position for the damage being dealt /// </summary> Assets/Scripts/Core/Health/HealthChangeInfo.cs
@@ -14,6 +14,26 @@ public float newHealth; /// <summary> /// 是否存在魔法护盾 /// </summary> public bool IsExistShieldWall { get; set; } /// <summary> /// 魔法护盾最大生命值 /// </summary> public float ShieldWallMaxHealth; /// <summary> /// 魔法护盾当前生命值 /// </summary> public float ShieldWallCurrentHealth; /// <summary> /// 上一次的魔法护盾生命值 /// </summary> public float ShieldWallOldHealth; /// <summary> /// 用于标注是由哪个种类的Tower造成的伤害. /// </summary> public int attributeId; @@ -29,5 +49,15 @@ { get { return Mathf.Abs(healthDifference); } } public float ShieldWallHealthDifference { get { return ShieldWallCurrentHealth - ShieldWallOldHealth; } } public float AbsShieldWallHealthDifference { get { return Mathf.Abs(ShieldWallHealthDifference); } } } } Assets/Scripts/Core/Health/HealthVisualizer.cs
@@ -108,9 +108,11 @@ if (m_Damageable != null) { m_Damageable.healthChanged -= OnHealthChanged; m_Damageable.ShieldWallHealthChanged -= OnShieldWallHealthChanged; } m_Damageable = damageable; m_Damageable.healthChanged += OnHealthChanged; m_Damageable.ShieldWallHealthChanged += OnShieldWallHealthChanged; } /// <summary> @@ -167,5 +169,10 @@ { UpdateHealth(m_Damageable.normalisedHealth); } private void OnShieldWallHealthChanged(HealthChangeInfo healthChangeInfo) { Debug.Log("--------------------- 获得魔法护盾 ---------------------"); } } } Assets/Scripts/TowerDefense/Agents/Agent.cs
@@ -296,6 +296,7 @@ { this.configuration.maxHealth = health; this.configuration.startingHealth = health; this.configuration.SetMaxHealth(health); this.configuration.Init(); this.configuration.SetHealth(health); @@ -468,6 +469,8 @@ timeToPoisonHurt = 0; bShieldBreak = false; bInDeathAct = false; configuration.ClearShieldWall(); StopFrostParticle(); //this.SetTargetableMatColor(Color.white); @@ -875,6 +878,7 @@ protected virtual void Update() { this.UpdateAction(); HandleShieldWall(); // 处理死亡状态了,不必再移动: if (bInDeathAct || !CanMove) return; @@ -891,6 +895,25 @@ } /// <summary> /// 处理魔法护盾血量值 /// </summary> protected void HandleShieldWall() { if (configuration.IsExistShieldWall) { if (configuration.ShieldWallCurrentHealth <= 0.00001f) configuration.IsExistShieldWall = false; else if (configuration.ShieldWallEffectiveTime > 0.00001f) { if (configuration.ShieldWallRemainTime <= 0.00001f) configuration.IsExistShieldWall = false; else configuration.ShieldWallRemainTime -= Time.deltaTime; } } } /// <summary> /// 限制当前Agent的移动位置,让Agent的移动看起来更帅一些 /// </summary> protected void restrictAgentPos() Assets/Scripts/TowerDefense/Level/AgentInsManager.cs
@@ -252,10 +252,40 @@ { list[j].CanMove = canMove; } break; } } } /// <summary> /// 根据赛道获得该赛道的所有敌人 /// </summary> /// <param name="tunel">赛道id (1~5)</param> /// <param name="isOppo">是否是对手的赛道</param> /// <returns></returns> public List<Agent> GetAgentsByTunel(int tunel, bool isOppo = false) { WaveLineAgentInsMgr[] waveLineAgents = isOppo ? getOppoWaveLineList() : GetWaveLineList(); List<Agent> ret = new List<Agent>(); for (int i = 0; i < waveLineAgents.Length; ++i) { if (i == tunel - 1) { for (int j = 0; j < waveLineAgents[i].listAgent.Count; ++j) { if (waveLineAgents[i].listAgent[j].AgentType == SpawnAgentType.Normal) ret.Add(waveLineAgents[i].listAgent[j]); } return ret; } } return null; } public List<Agent> agentList { get { return this.agentInsList; } Assets/Scripts/TowerDefense/UI/EndlessBossCtrl.cs
@@ -26,11 +26,13 @@ public Image Title; private string titlePath = "UI/Endless/SkillTitle/"; // Start is called before the first frame update private void Start() { ColorVal = 0; EventCenter.Ins.Add((int)KTGMGemClient.EventType.EndlessBossSkillGlintTitle, Glint); EventCenter.Ins.Add<int>((int)KTGMGemClient.EventType.EndlessBossSkillGlintTitle, Glint); } // Update is called once per frame @@ -39,8 +41,9 @@ } private void Glint() private void Glint(int skillType) { Title.sprite = Resources.Load<Sprite>($"{titlePath}{skillType}"); //设置一个DOTween队列 Sequence flashSeq = DOTween.Sequence(); Color c = Title.color; Assets/Scripts/TowerDefense/UI/EndlessBossSkill/BossSkillBubbleBomb.cs
@@ -1,5 +1,3 @@ using TowerDefense.UI.HUD; using Core.Utilities; using System.Collections.Generic; using UnityEngine; using TowerDefense.Agents; Assets/Scripts/TowerDefense/UI/EndlessBossSkill/BossSkillShieldWall.cs
@@ -1,4 +1,6 @@ using System.Collections.Generic; using UnityEngine; using TowerDefense.Agents; /** * 魔法护盾 @@ -16,18 +18,30 @@ /// </summary> public override void ReleaseSkill() { base.ReleaseSkill(); List<int> tunelIdList = GetTunelList(); if (tunelIdList.Count > 0) { for (int i = 0; i < tunelIdList.Count; ++i) { List<Agent> agents = AgentInsManager.instance.GetAgentsByTunel(tunelIdList[i]); if (agents == null) continue; for (int j = 0; j < agents.Count; ++j) { float shieldValue = agents[j].configuration.currentHealth * SkillData.effect[0]; agents[j].configuration.AddShieldWall(shieldValue, SkillData.effect[1]); } } } } public override void Init() { base.Init(); Debug.Log("--------------------- 魔法护盾技能初始化 ---------------------"); } public override void Update(float deltaTime) { IsCDCompleted = false; } } } Assets/Scripts/TowerDefense/UI/EndlessBossSkill/EndlessBossSkillManager.cs
@@ -131,7 +131,7 @@ { currentSkill = cdList[i]; EventCenter.Ins.Add((int)KTGMGemClient.EventType.EndlessBossSkillGlintTitleCompleted, OnGlintTitleCompleted); EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.EndlessBossSkillGlintTitle); EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.EndlessBossSkillGlintTitle, (int)cdList[i].SkillType); isFloatWordCompleted = false; ChangeState(EndlessBossSkillState.FloatWord); break; Assets/Scripts/TowerDefense/UI/EndlessBossSkillAI/EndlessBossSkillAI.cs
@@ -12,7 +12,7 @@ public EndlessBossSkillAI(boss_skill param) { SkillData = param; // cx test 现在表里面没有配AI类型,所以默认全部是Normal // 现在表里面没有配AI类型,所以默认全部是Normal AIType = EndlessBossSkillAIType.Normal; } Assets/Scripts/TowerDefense/UI/HUD/EndlessGameUI.cs
@@ -737,7 +737,7 @@ /// <param name="opponent"></param> public void DestroyTowerGrid(int xidx) { // cx test 这里的逻辑已经不走了 // 这里的逻辑已经不走了 for (int i = 0; i < AttackRowNumbers; ++i) { if (TowerDestroyArr[xidx, i]) continue;