コード例 #1
0
        protected override void OnShowTowerLevelSuccess(Entity entity)
        {
            base.OnShowTowerLevelSuccess(entity);

            EntityTowerLevel entityTowerLevel = entity.Logic as EntityTowerLevel;

            targetter.SetAlignment(Alignment);
            targetter.SetTurret(entityTowerLevel.turret);
            targetter.SetSearchRange(entityDataTower.Tower.Range);
            targetter.ResetTargetter();

            AttackerData attackerData = AttackerData.Create(entityDataTower.Tower.Range,
                                                            entityDataTower.Tower.FireRate,
                                                            entityDataTower.Tower.IsMultiAttack,
                                                            entityDataTower.Tower.ProjectileType,
                                                            entityDataTower.Tower.ProjectileEntityId
                                                            );

            attacker.SetData(attackerData, entityDataTower.Tower.ProjectileData);
            attacker.SetTargetter(targetter);
            attacker.SetProjectilePoints(entityTowerLevel.projectilePoints);
            attacker.SetEpicenter(entityTowerLevel.epicenter);
            attacker.SetLaunch(entityTowerLevel.launcher);
            attacker.ResetAttack();
        }
コード例 #2
0
        protected override void OnShowTowerLevelSuccess(Entity entity)
        {
            base.OnShowTowerLevelSuccess(entity);

            EntityTowerLevel entityTowerLevel = entity.Logic as EntityTowerLevel;

            targetter.SetAlignment(Alignment);
            targetter.SetTurret(entityTowerLevel.turret);
            targetter.SetSearchRange(entityDataTower.Tower.Range);
            targetter.ResetTargetter();

            targetter.targetEntersRange += OnTargetEntersRange;
            targetter.targetExitsRange  += OnTargetExitsRange;

            foreach (var item in slowList)
            {
                item.ApplySlow(entityDataTower.Tower.SerialId, entityDataTower.Tower.SpeedDownRate);
            }
        }
コード例 #3
0
        protected override void OnShow(object userData)
        {
            base.OnShow(userData);

            EntityDataEnemy = userData as EntityDataEnemy;

            if (EntityDataEnemy == null)
            {
                Log.Error("Entity enemy '{0}' entity data invaild.", Id);
                return;
            }

            hide          = false;
            Agent.enabled = true;
            LevelPath     = EntityDataEnemy.LevelPath;
            hp            = EntityDataEnemy.EnemyData.MaxHP;
            dataPlayer    = GameEntry.Data.GetData <DataPlayer>();

            Attacker.SetOwnerEntity(Entity);
            Targetter.SetAlignment(Alignment);
            Targetter.SetTurret(turret);
            Targetter.SetSearchRange(EntityDataEnemy.EnemyData.Range);
            Targetter.ResetTargetter();

            AttackerData attackerData = AttackerData.Create(EntityDataEnemy.EnemyData.Range,
                                                            EntityDataEnemy.EnemyData.FireRate,
                                                            EntityDataEnemy.EnemyData.IsMultiAttack,
                                                            EntityDataEnemy.EnemyData.ProjectileType,
                                                            EntityDataEnemy.EnemyData.ProjectileEntityId
                                                            );

            Attacker.SetData(attackerData, EntityDataEnemy.EnemyData.ProjectileData);
            Attacker.SetTargetter(Targetter);
            Attacker.SetProjectilePoints(projectilePoints);
            Attacker.SetEpicenter(epicenter);
            Attacker.SetLaunch(launcher);
            Attacker.ResetAttack();

            Targetter.OnShow(userData);
            Attacker.OnShow(userData);

            CreateFsm();
        }