Exemple #1
0
        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);
            }
        }
Exemple #2
0
        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);
            }
        }
Exemple #3
0
        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);
            }
        }
Exemple #4
0
        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);
            }
        }
Exemple #5
0
        /// <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);
            }
        }
Exemple #6
0
        /// <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);
                }
            }
        }
Exemple #7
0
        /// <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);
        }