public void OnChangeHeroTitle(GameEvent ge, EventParameter parameter) { ActorHealth health = parameter.objParameter as ActorHealth; HPBar bar; if (mActorHPBar.TryGetValue(health, out bar)) { bar.ChangeHeroTitle(parameter.stringParameter); } }
public void OnChangeFaction(GameEvent ge, EventParameter parameter) { ActorHealth health = parameter.objParameter as ActorHealth; HPBar bar; if (mActorHPBar.TryGetValue(health, out bar)) { bar.ChangeFaction(parameter.intParameter); } }
public void OnGameEventChangeNode(GameEvent ge, EventParameter parameter) { ActorHealth health = parameter.objParameter as ActorHealth; HPBar bar; if (mActorHPBar.TryGetValue(health, out bar)) { bar.SetBindNode(parameter.goParameter, parameter.stringParameter); } }
public void OnGameEventPetUpdate(GameEvent ge, EventParameter parameter) { ActorHealth health = parameter.objParameter as ActorHealth; HPBar bar; if (mActorHPBar.TryGetValue(health, out bar)) { bar.SetPetLevel(health.Actor); } }
/// <summary> /// 血条销毁处理。 /// </summary> public void OnGameEventDestory(GameEvent ge, EventParameter parameter) { ActorHealth health = parameter.objParameter as ActorHealth; HPBar bar; if (mActorHPBar.TryGetValue(health, out bar)) { mActorHPBar.Remove(health); RemoveHPBar(bar); } }
/// <summary> /// 血条PK状态改变。 /// </summary> public void OnGameEventPKStatus(GameEvent ge, EventParameter parameter) { ActorHealth health = parameter.objParameter as ActorHealth; if (health.ActorType != ActorType.AT_LOCAL_PLAYER && health.ActorType != ActorType.AT_REMOTE_PLAYER) { return; } HPBar bar; if (mActorHPBar.TryGetValue(health, out bar)) { if (health.ActorType == ActorType.AT_LOCAL_PLAYER) { bar.InitPKStatus(PlayerData.Instance.CurPKState); } else { bar.InitPKStatus(health.Actor as OtherPlayer); } } }
/// <summary> /// 血条创建处理。 /// </summary> public void OnGameEventCreate(GameEvent ge, EventParameter parameter) { ActorHealth health = parameter.objParameter as ActorHealth; HPBar bar; int num = 1; if (health.ActorType == ActorType.AT_BOSS) { num = (health.Actor as MonsterObj).MonsterConfig.Get <int>("hpCount"); } if (mActorHPBar.TryGetValue(health, out bar)) { bar.Init(health.Actor.gameObject, health.HPProgress, num, true); return; } bar = GetHPBar(health.ActorType); if (bar == null) { return; } bar.Init(health.Actor.gameObject, health.HPProgress, num); mActorHPBar.Add(health, bar); }