diff --git a/meng_yao/Assets/Prefabs/charatar/laohu.prefab b/meng_yao/Assets/Prefabs/charatar/laohu.prefab index aef73c763..0895af44e 100644 --- a/meng_yao/Assets/Prefabs/charatar/laohu.prefab +++ b/meng_yao/Assets/Prefabs/charatar/laohu.prefab @@ -366,6 +366,7 @@ GameObject: - component: {fileID: -3836672401185760439} - component: {fileID: 1608620729910401442} - component: {fileID: 7351378797470834992} + - component: {fileID: 1061754087244483355} m_Layer: 0 m_Name: laohu m_TagString: Player @@ -418,6 +419,7 @@ MonoBehaviour: retbutton: {fileID: 0} ClosureObj: {fileID: 0} id: M_H_001 + Name: camp: 0 hp: 100 dieIndex: -1 @@ -427,6 +429,15 @@ MonoBehaviour: _Canvas: {fileID: 0} spriteRenderers: {fileID: 0} HurtDirectin: 0 + Quality: + Elements: + Info: + SkillId: + AttackType: + AttackActionType: + AttackCD: 0 + CritRate: 0 + CriticalHitRateBonus: 0 gold: 10 MaxAttack: 10 MinAttack: 10 @@ -539,3 +550,24 @@ SpriteRenderer: m_WasSpriteAssigned: 0 m_MaskInteraction: 0 m_SpriteSortPoint: 0 +--- !u!114 &1061754087244483355 +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: b8d04d25bab1a3541925d4cc205ad1d8, type: 3} + m_Name: + m_EditorClassIdentifier: + role: {fileID: 8433650274028726420} + fun: {fileID: 0} + DamageUp: 1 + AttackRange: 1 + AttackCooldown: 1 + AttackDuration: 1 + NumberOfBullets: 1 + SpeedOfBullets: 1 + CritRate: 1 diff --git a/meng_yao/Assets/script/A_Fight/SkillBox.cs b/meng_yao/Assets/script/A_Fight/SkillBox.cs index 8e8223244..c69389f25 100644 --- a/meng_yao/Assets/script/A_Fight/SkillBox.cs +++ b/meng_yao/Assets/script/A_Fight/SkillBox.cs @@ -103,6 +103,7 @@ public class SkillBox : Base obj.GetComponent().infobox_skill_up = infobox_skill; obj.GetComponent().MySkill = info.skills[j]; obj.GetComponent().mengyao = MengyaoInfo.Instance.mengyaoIdToRole[info.temp_id]; + obj.GetComponent().index = j + 1; } break; } @@ -191,10 +192,4 @@ public class SkillBox : Base zhanhunicon.DOScale(1f, 0.1f).SetEase(Ease.InBack); }); } - - void OnDestroy() - { - //mengyaoRole = null; - } - } diff --git a/meng_yao/Assets/script/A_Fight/SkillUp/SkillUp.cs b/meng_yao/Assets/script/A_Fight/SkillUp/SkillUp.cs index 095d45059..2b1b168e3 100644 --- a/meng_yao/Assets/script/A_Fight/SkillUp/SkillUp.cs +++ b/meng_yao/Assets/script/A_Fight/SkillUp/SkillUp.cs @@ -3,10 +3,10 @@ using System.Collections.Generic; using UnityEngine; -public class SkillUp : MonoBehaviour +public class SkillUp : Fun { [Header("基类")] public Role role; - [HideInInspector]public Fun fun;//用于buff的创建 + [Header("攻击伤害加成倍数")] public float DamageUp=1f; [Header("攻击范围加成倍数")] public float AttackRange = 1f; [Header("攻击冷却加成倍速")] public float AttackCooldown = 1f; @@ -71,15 +71,15 @@ public class SkillUp : MonoBehaviour } public virtual void Skill_1_1() { } - public virtual void Skill_1_2() { DamageUp *= 1.15f; } + public virtual void Skill_1_2() { DamageUp *= 1.15f; Debug.LogError("使用技能1-2"); } public virtual void Skill_1_3() { } - public virtual void Skill_1_4() { DamageUp *= 1.35f; } + public virtual void Skill_1_4() { DamageUp *= 1.35f; Debug.LogError("使用技能1-4"); } public virtual void Skill_1_5() { } public virtual void Skill_2_1() { } - public virtual void Skill_2_2() { DamageUp *= 1.15f; } - public virtual void Skill_2_3() { DamageUp *= 1.35f; } - public virtual void Skill_2_4() { } + public virtual void Skill_2_2() { DamageUp *= 1.15f; Debug.LogError("使用技能2-2"); } + public virtual void Skill_2_3() { } + public virtual void Skill_2_4() { DamageUp *= 1.35f; Debug.LogError("使用技能2-4"); } public virtual void Skill_2_5() { } } diff --git a/meng_yao/Assets/script/A_Fight/SkillUp/laohuSkillUp.cs b/meng_yao/Assets/script/A_Fight/SkillUp/laohuSkillUp.cs index 1739393b6..0c69be2ad 100644 --- a/meng_yao/Assets/script/A_Fight/SkillUp/laohuSkillUp.cs +++ b/meng_yao/Assets/script/A_Fight/SkillUp/laohuSkillUp.cs @@ -14,6 +14,7 @@ public class laohuSkillUp :SkillUp public override void Skill_1_1() { base.AttackRange *= 2; + Debug.LogError("使用技能1-1"); } /// /// 被火焰伤害的敌人有20%概率原地眩晕1秒。射程减少1格 @@ -22,10 +23,11 @@ public class laohuSkillUp :SkillUp { base.AttackRange *= 0.75f; // 创建一个眩晕 Buff(持续1秒,20%概率) - Action decelerationBuff = fun.CreateDecelerationBuff(1f, 0.2f); + Action decelerationBuff = CreateDecelerationBuff(1f, 0.2f); // 将 Buff 添加到玩家的 storageBuff 列表中 role.AddBuff(role.storageBuff,decelerationBuff); + Debug.LogError("使用技能1-3"); } /// /// 喷火冷却时间减少50%,持续喷火时间减少50% @@ -34,6 +36,8 @@ public class laohuSkillUp :SkillUp { base.AttackCooldown *= 2; base.AttackDuration *= 0.5f; + + Debug.LogError("使用技能1-5"); } diff --git a/meng_yao/Assets/script/A_Fight/Skill_Spend.cs b/meng_yao/Assets/script/A_Fight/Skill_Spend.cs index a5d1db33c..e41dcc982 100644 --- a/meng_yao/Assets/script/A_Fight/Skill_Spend.cs +++ b/meng_yao/Assets/script/A_Fight/Skill_Spend.cs @@ -41,6 +41,7 @@ public class Skill_Spend : MonoBehaviour //[HideInInspector] public GameObject mengyao;//对应的role + public int index;//技能序号 // Start is called before the first frame update void Start() { @@ -53,12 +54,6 @@ public class Skill_Spend : MonoBehaviour UpgradeBtn.onClick.AddListener(UpgradeClick); } - - public void Init() - { - - } - void UpgradeClick() { @@ -67,10 +62,6 @@ public class Skill_Spend : MonoBehaviour infobox_skill_up.gameObject.SetActive(true); } - - - - void SpendClick() { musk.gameObject.SetActive(false); diff --git a/meng_yao/Assets/script/A_Fight/infobox_skill_up.cs b/meng_yao/Assets/script/A_Fight/infobox_skill_up.cs index 2134bb150..f331fe60c 100644 --- a/meng_yao/Assets/script/A_Fight/infobox_skill_up.cs +++ b/meng_yao/Assets/script/A_Fight/infobox_skill_up.cs @@ -32,27 +32,16 @@ public class infobox_skill_up : MonoBehaviour if (Skillspend.levelNumber =0) { SkillBox.instance.UpdataExp(-Skillspend.spendNumber); - Debug.Log(LevelText.text); Skillspend.levelNumber++; - /*UpgradeBtn.GetComponent().sprite = minLevelimg; - UpgradeBtn.transform.Find("UpgradText").GetComponent().text = "升级"; - UpgradeBtn.enabled = true;*/ SwitchLevel(Skillspend.levelNumber); - Debug.Log(Skillspend.levelNumber); + + //因为一开始是没有技能,所以先Skillspend.levelNumber++; + Skillspend.mengyao.GetComponent().UseSkill(Skillspend.index, Skillspend.levelNumber); } else { Debug.Log("战魂不足"); } - /*if(Skillspend.levelNumber >= Skillspend.Maxlevel) - { - Skillspend.levelNumber = Skillspend.Maxlevel; - UpgradeBtn.GetComponent().sprite = maxlevelimg; - UpgradeBtn.transform.Find("UpgradText").GetComponent().text = "等级已满"; - SwitchLevel(Skillspend.levelNumber); - return; - }*/ - } void BtnUpdata() @@ -69,12 +58,10 @@ public class infobox_skill_up : MonoBehaviour UpgradeBtn.transform.Find("UpgradText").GetComponent().text = "升级"; UpgradeBtn.enabled = true; } - - } - public void SwitchLevel(int level) + public void SwitchLevel(int level) { switch (level) {