This commit is contained in:
liuliang 2024-12-25 15:20:51 +08:00
commit e9a9cd6509
11 changed files with 155 additions and 40 deletions

View File

@ -614,7 +614,7 @@ SpriteRenderer:
m_SortingLayerID: 0 m_SortingLayerID: 0
m_SortingLayer: 0 m_SortingLayer: 0
m_SortingOrder: 0 m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: 5a21d33cca7048a46aed91d4e3e32ec3, type: 3} m_Sprite: {fileID: 21300000, guid: aa6f66265746cb041bbfdf887abe64f9, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1} m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0 m_FlipX: 0
m_FlipY: 0 m_FlipY: 0
@ -637,6 +637,7 @@ GameObject:
- component: {fileID: 4205844203331515742} - component: {fileID: 4205844203331515742}
- component: {fileID: 9162732182785843388} - component: {fileID: 9162732182785843388}
- component: {fileID: 8475889323091750017} - component: {fileID: 8475889323091750017}
- component: {fileID: 7780224884041102910}
m_Layer: 5 m_Layer: 5
m_Name: myCanva m_Name: myCanva
m_TagString: Untagged m_TagString: Untagged
@ -728,6 +729,17 @@ MonoBehaviour:
m_BlockingMask: m_BlockingMask:
serializedVersion: 2 serializedVersion: 2
m_Bits: 4294967295 m_Bits: 4294967295
--- !u!210 &7780224884041102910
SortingGroup:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6362446851701897971}
m_Enabled: 1
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!1 &7634432846538185418 --- !u!1 &7634432846538185418
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View File

@ -562,8 +562,9 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: b8d04d25bab1a3541925d4cc205ad1d8, type: 3} m_Script: {fileID: 11500000, guid: b8d04d25bab1a3541925d4cc205ad1d8, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
retbutton: {fileID: 0}
ClosureObj: {fileID: 0}
role: {fileID: 8433650274028726420} role: {fileID: 8433650274028726420}
fun: {fileID: 0}
DamageUp: 1 DamageUp: 1
AttackRange: 1 AttackRange: 1
AttackCooldown: 1 AttackCooldown: 1
@ -571,3 +572,4 @@ MonoBehaviour:
NumberOfBullets: 1 NumberOfBullets: 1
SpeedOfBullets: 1 SpeedOfBullets: 1
CritRate: 1 CritRate: 1
DamageOfSky: 1

View File

@ -396,6 +396,7 @@ GameObject:
- component: {fileID: 8433650274028726420} - component: {fileID: 8433650274028726420}
- component: {fileID: -3836672401185760439} - component: {fileID: -3836672401185760439}
- component: {fileID: 1608620729910401442} - component: {fileID: 1608620729910401442}
- component: {fileID: 3258498600701209889}
m_Layer: 0 m_Layer: 0
m_Name: mkl m_Name: mkl
m_TagString: Player m_TagString: Player
@ -528,3 +529,30 @@ MonoBehaviour:
m_EditorClassIdentifier: m_EditorClassIdentifier:
tower: {fileID: 0} tower: {fileID: 0}
Tag: tower Tag: tower
--- !u!114 &3258498600701209889
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8433650275485930554}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: cf06a056a8f837740a4fca76de3a5ed5, type: 3}
m_Name:
m_EditorClassIdentifier:
retbutton: {fileID: 0}
ClosureObj: {fileID: 0}
role: {fileID: 8433650274028726420}
DamageUp: 0
AttackRange: 0
AttackCooldown: 0
AttackDuration: 0
NumberOfBullets: 0
SpeedOfBullets: 0
CriticalRate: 0
CriticalDamage: 0
DamageOfSky: 0
DamageOfland: 0
DamageOfBig: 0
DamageOfMin: 0

View File

@ -396,6 +396,7 @@ GameObject:
- component: {fileID: 8433650274028726420} - component: {fileID: 8433650274028726420}
- component: {fileID: -3836672401185760439} - component: {fileID: -3836672401185760439}
- component: {fileID: 1608620729910401442} - component: {fileID: 1608620729910401442}
- component: {fileID: 206052671066122143}
m_Layer: 0 m_Layer: 0
m_Name: qi_e m_Name: qi_e
m_TagString: Player m_TagString: Player
@ -449,6 +450,7 @@ MonoBehaviour:
retbutton: {fileID: 0} retbutton: {fileID: 0}
ClosureObj: {fileID: 0} ClosureObj: {fileID: 0}
id: M_S_001 id: M_S_001
Name:
camp: 0 camp: 0
hp: 100 hp: 100
dieIndex: -1 dieIndex: -1
@ -458,6 +460,15 @@ MonoBehaviour:
_Canvas: {fileID: 0} _Canvas: {fileID: 0}
spriteRenderers: {fileID: 0} spriteRenderers: {fileID: 0}
HurtDirectin: 0 HurtDirectin: 0
Quality:
Elements:
Info:
SkillId:
AttackType:
AttackActionType:
AttackCD: 0
CritRate: 0
CriticalHitRateBonus: 0
gold: 10 gold: 10
MaxAttack: 10 MaxAttack: 10
MinAttack: 10 MinAttack: 10
@ -518,3 +529,30 @@ MonoBehaviour:
m_EditorClassIdentifier: m_EditorClassIdentifier:
tower: {fileID: 0} tower: {fileID: 0}
Tag: tower Tag: tower
--- !u!114 &206052671066122143
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8433650275485930554}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0f2e2ca90067ba742b2ebdc8e467e4bd, type: 3}
m_Name:
m_EditorClassIdentifier:
retbutton: {fileID: 0}
ClosureObj: {fileID: 0}
role: {fileID: 8433650274028726420}
DamageUp: 0
AttackRange: 0
AttackCooldown: 0
AttackDuration: 0
NumberOfBullets: 0
SpeedOfBullets: 0
CriticalRate: 0
CriticalDamage: 0
DamageOfSky: 0
DamageOfland: 0
DamageOfBig: 0
DamageOfMin: 0

View File

@ -158,6 +158,8 @@ MonoBehaviour:
role: {fileID: 8433650274028726420} role: {fileID: 8433650274028726420}
panelPrefab: {fileID: 8782491854383104488, guid: 61ffa7d22a51b1e48a3495af66e30de0, type: 3} panelPrefab: {fileID: 8782491854383104488, guid: 61ffa7d22a51b1e48a3495af66e30de0, type: 3}
attackRange: {fileID: 681042887138380540} attackRange: {fileID: 681042887138380540}
isShowPanel: 0
instantiatedPanel: {fileID: 0}
--- !u!1 &6070656209494785206 --- !u!1 &6070656209494785206
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -363,6 +365,7 @@ MonoBehaviour:
animator: {fileID: 9037670100243302216} animator: {fileID: 9037670100243302216}
fireAni: {fileID: 0} fireAni: {fileID: 0}
BulletStartPos: {fileID: 2562350995381512747} BulletStartPos: {fileID: 2562350995381512747}
AttackSpeed: 1
direction: {x: 0, y: 0} direction: {x: 0, y: 0}
--- !u!58 &1338343970434073545 --- !u!58 &1338343970434073545
CircleCollider2D: CircleCollider2D:
@ -446,6 +449,7 @@ MonoBehaviour:
retbutton: {fileID: 0} retbutton: {fileID: 0}
ClosureObj: {fileID: 0} ClosureObj: {fileID: 0}
id: 0 id: 0
Name:
camp: 0 camp: 0
hp: 100 hp: 100
dieIndex: -1 dieIndex: -1
@ -455,7 +459,18 @@ MonoBehaviour:
_Canvas: {fileID: 0} _Canvas: {fileID: 0}
spriteRenderers: {fileID: 0} spriteRenderers: {fileID: 0}
HurtDirectin: 0 HurtDirectin: 0
Quality:
Elements:
Info:
SkillId:
AttackType:
AttackActionType:
AttackCD: 0
CritRate: 0
CriticalHitRateBonus: 0
gold: 10 gold: 10
MaxAttack: 10
MinAttack: 10
physicalArmor: 10 physicalArmor: 10
magicArmor: 5 magicArmor: 5
Navigation: {fileID: 0} Navigation: {fileID: 0}
@ -467,6 +482,9 @@ MonoBehaviour:
mycollider: {fileID: 1338343970434073545} mycollider: {fileID: 1338343970434073545}
attackClass: {fileID: 7276635428522831207} attackClass: {fileID: 7276635428522831207}
CurrentIndex: 0 CurrentIndex: 0
hitIndex: 2
normalIndex: 0
isHit: 0
enemyId: enemyId:
moveSpeed: 0 moveSpeed: 0
harmNumber: 0 harmNumber: 0

View File

@ -7,15 +7,19 @@ public class SkillUp : Fun
{ {
[Header("基类")] public Role role; [Header("基类")] public Role role;
[Header("攻击伤害加成倍数")] public float DamageUp=1f; [Header("攻击伤害加成")] public float DamageUp=0f;
[Header("攻击范围加成倍数")] public float AttackRange = 1f; [Header("攻击范围加成")] public float AttackRange = 0f;
[Header("攻击冷却加成倍速")] public float AttackCooldown = 1f; [Header("攻击冷却加成")] public float AttackCooldown = 0f;
[Header("攻击持续时间加成倍速")] public float AttackDuration = 1f; [Header("攻击持续时间加成")] public float AttackDuration = 0f;
[Header("攻击子弹数量加成倍速")] public int NumberOfBullets = 1; [Header("攻击子弹数量加成")] public int NumberOfBullets = 0;
[Header("攻击子弹速度加成倍速")] public float SpeedOfBullets = 1f; [Header("攻击子弹速度加成")] public float SpeedOfBullets = 0f;
[Header("暴击率倍率加成")]public float CritRate = 1f; [Header("暴击率倍率加成")]public float CriticalRate = 0f;
[Header("暴击伤害倍率加成")]public float CriticalDamage = 0f;
[Header("对空伤害加成")] public float DamageOfSky = 1f; [Header("对空伤害加成")] public float DamageOfSky = 0f;
[Header("对地伤害加成")] public float DamageOfland = 0f;
[Header("对大型敌人加成")] public float DamageOfBig = 0f;
[Header("对小型型敌人加成")] public float DamageOfMin = 0f;
// 存储技能加成效果 // 存储技能加成效果
private Dictionary<string, Dictionary<int, System.Action>> skillUpgrades = new Dictionary<string, Dictionary<int, System.Action>>(); private Dictionary<string, Dictionary<int, System.Action>> skillUpgrades = new Dictionary<string, Dictionary<int, System.Action>>();

View File

@ -12,7 +12,7 @@ public class laohuSkillUp :SkillUp
/// </summary> /// </summary>
public override void Skill_1_1() public override void Skill_1_1()
{ {
base.AttackRange *= 2; base.AttackRange += 2;
Debug.LogError("使用技能1-1"); Debug.LogError("使用技能1-1");
} }
/// <summary> /// <summary>
@ -20,7 +20,7 @@ public class laohuSkillUp :SkillUp
/// </summary> /// </summary>
public override void Skill_1_3() public override void Skill_1_3()
{ {
base.AttackRange *= 0.75f; base.AttackRange += -1;
// 创建一个眩晕 Buff持续1秒20%概率) // 创建一个眩晕 Buff持续1秒20%概率)
Action<Role> decelerationBuff = CreateDecelerationBuff(1f, 0.2f); Action<Role> decelerationBuff = CreateDecelerationBuff(1f, 0.2f);
@ -33,8 +33,8 @@ public class laohuSkillUp :SkillUp
/// </summary> /// </summary>
public override void Skill_1_5() public override void Skill_1_5()
{ {
base.AttackCooldown *= 2; base.AttackCooldown += -0.5f;
base.AttackDuration *= 0.5f; base.AttackDuration += -0.5f;
Debug.LogError("使用技能1-5"); Debug.LogError("使用技能1-5");
} }
@ -45,7 +45,8 @@ public class laohuSkillUp :SkillUp
/// </summary> /// </summary>
public override void Skill_2_1() public override void Skill_2_1()
{ {
base.NumberOfBullets *= 3; base.NumberOfBullets += 3;
base.DamageUp += -0.5f;
Debug.LogError("使用技能2-1"); Debug.LogError("使用技能2-1");
} }
/// <summary> /// <summary>
@ -53,7 +54,7 @@ public class laohuSkillUp :SkillUp
/// </summary> /// </summary>
public override void Skill_2_3() public override void Skill_2_3()
{ {
base.AttackCooldown *= 0.95f; base.AttackCooldown += 0.05f;
//buff //buff
Action<Role> decelerationBuff = CreateSlowDownBuff(0.2f, 3f); Action<Role> decelerationBuff = CreateSlowDownBuff(0.2f, 3f);
// 将 Buff 添加到玩家的 storageBuff 列表中 // 将 Buff 添加到玩家的 storageBuff 列表中
@ -65,8 +66,8 @@ public class laohuSkillUp :SkillUp
/// </summary> /// </summary>
public override void Skill_2_5() public override void Skill_2_5()
{ {
base.AttackCooldown *= 0.7f; base.AttackCooldown += 0.3f;
base.AttackDuration *= 1.5f; base.AttackDuration += 0.5f;
Debug.LogError("使用技能2-5"); Debug.LogError("使用技能2-5");
} }
} }

View File

@ -9,21 +9,23 @@ public class mkl_SkillUp : SkillUp
/// </summary> /// </summary>
public override void Skill_1_1() public override void Skill_1_1()
{ {
base.AttackCooldown *= 0.75f; base.AttackCooldown += -0.25f;
} }
/// <summary> /// <summary>
/// 子弹飞行速度增加30%。攻击CD增加5% /// 子弹飞行速度增加30%。攻击CD增加5%
/// </summary> /// </summary>
public override void Skill_1_3() public override void Skill_1_3()
{ {
base.SpeedOfBullets *= 1.3f; base.SpeedOfBullets = 0.3f;
AttackCooldown += 0.05f;
} }
/// <summary> /// <summary>
/// 攻击增加20%暴击率 。攻击CD增加5% /// 攻击增加20%暴击率 。攻击CD增加5%
/// </summary> /// </summary>
public override void Skill_1_5() public override void Skill_1_5()
{ {
base.AttackCooldown *= 1.05f; base.AttackCooldown += 0.05f;
base.DamageUp += 0.2f;
} }
@ -32,21 +34,22 @@ public class mkl_SkillUp : SkillUp
/// </summary> /// </summary>
public override void Skill_2_1() public override void Skill_2_1()
{ {
base.DamageOfMin += 0.25f;
} }
/// <summary> /// <summary>
/// 对小型敌人增加40%伤害。 攻击CD增加5% /// 对小型敌人增加40%伤害。 攻击CD增加5%
/// </summary> /// </summary>
public override void Skill_2_3() public override void Skill_2_3()
{ {
base.DamageOfMin += 0.4f;
//buff base.AttackCooldown += 0.5f;
} }
/// <summary> /// <summary>
/// 每次攻击增加20%暴击率。射程减少1格 /// 每次攻击增加20%暴击率。射程减少1格
/// </summary> /// </summary>
public override void Skill_2_5() public override void Skill_2_5()
{ {
CriticalRate += 0.2f;
AttackRange += -1;
} }
} }

View File

@ -9,23 +9,23 @@ public class qieSkillUp : SkillUp
/// </summary> /// </summary>
public override void Skill_1_1() public override void Skill_1_1()
{ {
base.AttackCooldown *= 0.75f; base.AttackCooldown += -0.25f;
} }
/// <summary> /// <summary>
/// 增加子弹20%飞行速度。射程减少1格 /// 增加子弹20%飞行速度。射程减少1格
/// </summary> /// </summary>
public override void Skill_1_3() public override void Skill_1_3()
{ {
base.SpeedOfBullets *= 1.2f; base.SpeedOfBullets += 0.2f;
base.AttackRange *= 0.5f; base.AttackRange += -1;
} }
/// <summary> /// <summary>
/// 对处于减速的敌人造成额外30%伤害。 攻击CD增加5% /// 对处于减速的敌人造成额外30%伤害。 攻击CD增加5%
/// </summary> /// </summary>
public override void Skill_1_5() public override void Skill_1_5()
{ {
base.AttackCooldown *= 1.05f; base.AttackCooldown += 0.05f;
base.DamageUp += 0.3f;
} }
@ -34,21 +34,21 @@ public class qieSkillUp : SkillUp
/// </summary> /// </summary>
public override void Skill_2_1() public override void Skill_2_1()
{ {
base.DamageOfSky *= 1.25f; base.DamageOfSky += 0.25f;
} }
/// <summary> /// <summary>
/// 攻击CD减少10% /// 攻击CD减少10%
/// </summary> /// </summary>
public override void Skill_2_3() public override void Skill_2_3()
{ {
base.AttackCooldown *= 0.75f; base.AttackCooldown += 0.75f;
//buff
} }
/// <summary> /// <summary>
/// 对小型敌人增加25%伤害。射程减少1格 /// 对小型敌人增加25%伤害。射程减少1格
/// </summary> /// </summary>
public override void Skill_2_5() public override void Skill_2_5()
{ {
DamageOfMin += 0.25f;
AttackRange += -1;
} }
} }

View File

@ -89,14 +89,14 @@ public class SpawnPool : Base
} }
public void UpdateNodeList() public void UpdateNodeList()
{ {
// 获取所有带有 SortingGroup 组件的物体 // 获取所有带有 SortingGroup 组件的敌人对象
List<GameObject> gameObjectsList = new List<GameObject>(); List<GameObject> gameObjectsList = new List<GameObject>();
foreach (GameObject go in Enemys) foreach (GameObject go in Enemys)
{ {
// 获取该物体上的 SortingGroup 组件 // 获取该物体上的 SortingGroup 组件
SortingGroup sortingGroup = go.GetComponent<SortingGroup>(); SortingGroup sortingGroup = go.GetComponent<SortingGroup>();
if (sortingGroup != null&&go.activeSelf) if (sortingGroup != null && go.activeSelf)
{ {
// 添加到列表中 // 添加到列表中
gameObjectsList.Add(go); gameObjectsList.Add(go);
@ -106,19 +106,28 @@ public class SpawnPool : Base
// 按照 y 轴排序 // 按照 y 轴排序
gameObjectsList.Sort((a, b) => a.transform.position.y.CompareTo(b.transform.position.y)); gameObjectsList.Sort((a, b) => a.transform.position.y.CompareTo(b.transform.position.y));
// 设置 SortingGroup 的 sortingOrder // 设置 SortingGroup 和子 Canvas 的 sortingOrder
for (int i = 0; i < gameObjectsList.Count; i++) for (int i = 0; i < gameObjectsList.Count; i++)
{ {
SortingGroup sortingGroup = gameObjectsList[i].GetComponent<SortingGroup>(); SortingGroup sortingGroup = gameObjectsList[i].GetComponent<SortingGroup>();
if (sortingGroup != null) if (sortingGroup != null)
{ {
// 设置 sortingOrder 来决定显示的层级 // 计算排序顺序
sortingGroup.sortingOrder = gameObjectsList.Count - i+2; int order = gameObjectsList.Count - i + 2;
sortingGroup.sortingOrder = order;
// 获取子 Canvas 并设置其 sortingOrder
Canvas canvas = gameObjectsList[i].GetComponentInChildren<Canvas>();
if (canvas != null)
{
canvas.sortingOrder = order;
}
} }
} }
} }
void Update() void Update()
{ {
if (IsStartGet) if (IsStartGet)

View File

@ -84,7 +84,7 @@ public class cardContorl : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndD
MengyaoInfo.Instance.mengyaoIdToRole.Add(mY.GetComponent<Role>().id, mY); MengyaoInfo.Instance.mengyaoIdToRole.Add(mY.GetComponent<Role>().id, mY);
SpawnPool.intance.Enemys.Add(mY);//存入图层排序的数组
this.enabled = false; this.enabled = false;
cardBox.instance.ChangeInPlaceNumber(1); cardBox.instance.ChangeInPlaceNumber(1);
mask.SetActive(true); mask.SetActive(true);