Example #1
0
    public override async void BeginExecute()
    {
        base.BeginExecute();

        //OwnerEntity.Publish(new PlayAnimationTask());
        //EntityFactory.CreateWithParent<PlayAnimationTask>(this, "施法动作").ExecuteTaskAsync().Coroutine();

        var taskData = new CastProjectileTaskData();

        taskData.ProjectilePrefab = (AbilityEntity as Skill1001Entity).SkillConfigObject.SkillEffectObject;
        var task = EntityFactory.CreateWithParent <CastProjectileTask>(this, taskData);
        await task.ExecuteTaskAsync();

        AbilityEntity.ApplyAbilityEffectsTo(InputCombatEntity);

        EndExecute();
    }
Example #2
0
    public override async void BeginExecute()
    {
        base.BeginExecute();

        Hero.Instance.StopMove();
        Hero.Instance.PlayThenIdleAsync(Hero.Instance.AnimationComponent.SkillAnimation).Coroutine();
        Hero.Instance.SkillPlaying = true;
        Hero.Instance.transform.GetChild(0).eulerAngles = new Vector3(0, InputDirection, 0);

        var taskData = new CreateEffectTaskData();

        taskData.Position     = GetParent <CombatEntity>().Position;
        taskData.Direction    = InputDirection;
        taskData.LifeTime     = 2000;
        taskData.EffectPrefab = GetAbility <Skill1004Ability>().SkillConfigObject.SkillEffectObject;
        var task = EntityFactory.CreateWithParent <CreateEffectTask>(this, taskData);

        task.ExecuteTaskAsync().Coroutine();

        await TimerComponent.Instance.WaitAsync(1500);

        var taskData2 = new CreateTriggerTaskData();

        taskData2.Position               = GetParent <CombatEntity>().Position;
        taskData2.Direction              = InputDirection;
        taskData2.LifeTime               = 200;
        taskData2.TriggerPrefab          = GetAbility <Skill1004Ability>().SkillConfigObject.AreaCollider;
        taskData2.OnTriggerEnterCallback = (other) => {
            AbilityEntity.ApplyAbilityEffectsTo(other.GetComponent <Monster>().CombatEntity);
        };
        var task2 = EntityFactory.CreateWithParent <CreateTriggerTask>(this, taskData2);
        await task2.ExecuteTaskAsync();

        EndExecute();
        Hero.Instance.SkillPlaying = false;
    }
Example #3
0
    public override async void BeginExecute()
    {
        base.BeginExecute();

        var taskData2 = new CreateTriggerTaskData();

        taskData2.Position               = InputPoint;
        taskData2.TriggerPrefab          = (AbilityEntity as Skill1002Entity).SkillConfigObject.AreaCollider;
        taskData2.OnTriggerEnterCallback = (other) => {
            AbilityEntity.ApplyAbilityEffectsTo(other.GetComponent <Monster>().CombatEntity);
        };
        var task2 = EntityFactory.CreateWithParent <CreateTriggerTask>(this, taskData2);

        task2.ExecuteTaskAsync().Coroutine();

        var taskData = new CreateExplosionTaskData();

        taskData.TargetPoint     = InputPoint;
        taskData.ExplosionPrefab = (AbilityEntity as Skill1002Entity).SkillConfigObject.SkillEffectObject;
        var task = EntityFactory.CreateWithParent <CreateExplosionTask>(this, taskData);
        await task.ExecuteTaskAsync();

        EndExecute();
    }