| | |
| | | baseData.HP = value;
|
| | | if (hero != null)
|
| | | {
|
| | | hero.ActorInfo.SyncServerHp = value;
|
| | | hero.ActorInfo.ResetHp((int)value);
|
| | | }
|
| | | break;
|
| | |
| | | MaxHpEx = (ushort)valMaxEx; |
| | | } |
| | | |
| | | if (sid == PlayerDatas.Instance.PlayerId) |
| | | { |
| | | if (Hp == 0) |
| | | { |
| | | if (Hp != SyncServerHp) |
| | | { |
| | | Hp = SyncServerHp; |
| | | } |
| | | } |
| | | } |
| | | |
| | | // if (sid != PlayerDatas.Instance.PlayerId) |
| | | // { |
| | | // Debug.LogFormat("<color=yellow>设置血量 {0}, 当前hp: {1}, hpEx: {2}</color>", sid, Hp, HpEx); |
| | |
| | | // Debug.LogFormat("<color=red>---- 计算后, hp: {0}, hpEx: {1}</color>", Hp, HpEx); |
| | | // } |
| | | // } |
| | | if (sid == PlayerDatas.Instance.PlayerId) |
| | | { |
| | | if (Hp == 0) |
| | | { |
| | | if (Hp != SyncServerHp) |
| | | { |
| | | Hp = SyncServerHp; |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (OnHpChange != null) |
| | | { |