修复掉落两次奖励

This commit is contained in:
wulongxiao 2024-12-28 10:27:09 +08:00
parent c04f3f2ed9
commit 53e24b624e

View File

@ -1,19 +1,11 @@
using System; using System;
using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks; using System.Threading.Tasks;
using UnityEditor;
using UnityEngine; using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
using UnityEngine.UIElements;
using Debug = UnityEngine.Debug;
using Image = UnityEngine.UI.Image;
using DG.Tweening; using DG.Tweening;
using UnityEngine.SocialPlatforms;
public enum Camp public enum Camp
{/// <summary> {/// <summary>
/// 鯤소 /// 鯤소
@ -117,8 +109,8 @@ public class Role : Fun
} }
} }
[Header("掉落")] public float gold = 10f; [Header("掉落")] public int gold = 6;
public float Gold public int Gold
{ {
[DebuggerStepThrough] [DebuggerStepThrough]
get => gold; get => gold;
@ -219,7 +211,7 @@ public class Role : Fun
public void AddBuff(List<Action<Role>> buffs, Action<Role> buffAction) public void AddBuff(List<Action<Role>> buffs, Action<Role> buffAction)
{ {
buffs.Add(buffAction); buffs.Add(buffAction);
Debug.LogError(this.name + "添加buff到"+ buffs); UnityEngine.Debug.LogError(this.name + "添加buff到"+ buffs);
} }
/// <summary> /// <summary>
@ -229,7 +221,7 @@ public class Role : Fun
{ {
foreach (var buff in PlayerBuff) foreach (var buff in PlayerBuff)
{ {
Debug.LogError(this.name + "进入执行buff判断"); UnityEngine.Debug.LogError(this.name + "进入执行buff判断");
buff.Invoke(this); // 쉥菱성鱗槨커깃눈뒵 buff.Invoke(this); // 쉥菱성鱗槨커깃눈뒵
} }
@ -324,14 +316,11 @@ public class Role : Fun
if (!IsDead) if (!IsDead)
{ {
UIContorl.instance.Killnumber++; UIContorl.instance.Killnumber++;
//Destroy(gameObject); SkillBox.instance.AddExperience(gold, this.gameObject.transform);
IsDead = true; IsDead = true;
} }
HaveDieTime++; HaveDieTime++;
Debug.Log("die");
} }
} }
/// <summary> /// <summary>
@ -408,7 +397,7 @@ public class Role : Fun
Level = 1; Level = 1;
// 路零쏜귑 // 路零쏜귑
Gold = 10f; Gold = 10;
// 헌왕 Buff 죗깊 // 헌왕 Buff 죗깊
buffList.Clear(); buffList.Clear();