Beispiel #1
0
        public List <ActorBase> GetActorsByAffectType(AffectType type)
        {
            switch (type)
            {
            case AffectType.Ally:
                return(GetAllAlly());

            case AffectType.Host:
                if (m_Host == null)
                {
                    return(null);
                }
                else
                {
                    return(new List <ActorBase>()
                    {
                        m_Host
                    });
                }

            case AffectType.Enem:
                return(GetAllEnemy());

            case AffectType.Boss:
                List <ActorBase> list   = new List <ActorBase>();
                List <ActorBase> enemys = GetAllEnemy();
                for (int i = 0; i < enemys.Count; i++)
                {
                    ActorEnemy monster = enemys[i] as ActorEnemy;
                    if (monster != null && monster.ActorType == ActorType.Monster)
                    {
                        if (monster.IsBoss())
                        {
                            list.Add(monster);
                        }
                    }
                }
                return(list);

            case AffectType.Self:
                return(new List <ActorBase>()
                {
                    this
                });

            case AffectType.Each:
                return(GameEntry.Level.GetAllRoleActor());

            default:
                return(new List <ActorBase>());
            }
        }
Beispiel #2
0
        protected override void OnShow(object userData)
        {
            base.OnShow(userData);

            m_EnemyEntityData = userData as RoleEntityData;
            if (m_EnemyEntityData == null)
            {
                Log.Error("playerEntityData is null");
                return;
            }

            ActorType      actorType = m_EnemyEntityData.ActorType;
            BattleCampType campType  = m_EnemyEntityData.CampType;

            Actor = new ActorEnemy(this, actorType, campType, m_CharacterController,
                                   m_Animator);
            Actor.Init();
        }