Exemplo n.º 1
0
    public AnimeAction CreateHitDamageAction(BattleModel targetModel, AnimationClip hitEffect = null)
    {
        SequenceAction sequence = new SequenceAction();

        sequence.name = "HitSequence";

        if (hitEffect != null)
        {
            SimpleAnimationAction effectAction = new SimpleAnimationAction();
            effectAction.clip          = slashEffect;
            effectAction.spawnPosition = targetModel.transform.position + new Vector3(0, 1, -2);
            sequence.AddAction(effectAction);
        }

        HitAction hitAction = new HitAction();

        hitAction.name  = "enemyHit";
        hitAction.actor = targetModel;
        sequence.AddAction(hitAction);


        HitValueAction damageAction = new HitValueAction();

        damageAction.valueTextPrefab = hitValuePrefab;
        damageAction.hitValue        = 1000;
        damageAction.position        = targetModel.transform.position + new Vector3(0, 2, -2);
        sequence.AddAction(damageAction);

        return(sequence);
    }
Exemplo n.º 2
0
    public void ScheduleAction()
    {
        ScheduleAction scheduleAction = new ScheduleAction();

        HitValueAction hitAction;

        hitAction = new HitValueAction();
        hitAction.valueTextPrefab = hitValuePrefab;
        hitAction.hitValue        = 999;
        hitAction.position        = new Vector3(0, 2, -2);
        scheduleAction.Schedule(0.5f, hitAction);

        hitAction = new HitValueAction();
        hitAction.valueTextPrefab = hitValuePrefab;
        hitAction.hitValue        = 888;
        hitAction.position        = new Vector3(1, 1, -2);
        scheduleAction.Schedule(1.0f, hitAction);

        hitAction = new HitValueAction();
        hitAction.valueTextPrefab = hitValuePrefab;
        hitAction.hitValue        = 777;
        hitAction.position        = new Vector3(2, 0, -2);
        scheduleAction.Schedule(4.0f, hitAction);


        // SimpleAnimationAction action = new SimpleAnimationAction();
        // action.clip = animeClip;
        // action.spawnPosition = new Vector3(0, 0, zOrderVfx);
        // action.repeat = 3;
        // action.destroySelf = false;

        actionManager.RunAction(scheduleAction);
    }
Exemplo n.º 3
0
    public void EnemyHit()
    {
        SequenceAction sequence = new SequenceAction();

        sequence.name = "HitSequence";

        AnimatorAction action = new AnimatorAction();

        action.name         = "enemyHit";
        action.animator     = enemyAnimator;
        action.triggerState = "Hit";
        sequence.AddAction(action);


        HitValueAction hitAction = new HitValueAction();

        hitAction.valueTextPrefab = hitValuePrefab;
        hitAction.hitValue        = 1000;
        hitAction.position        = enemyAnimator.transform.position + new Vector3(0, 1, -2);
        sequence.AddAction(hitAction);
        //hitAction.position = new Vector3(0, 0, -2);

        actionManager.RunAction(sequence);
        //action.animator = bat
    }
    public AnimeAction CreateHitValueAction(BattleModel targetModel)
    {
        HitValueAction damageAction = new HitValueAction();

        damageAction.valueTextPrefab = hitValuePrefab;
        damageAction.hitValue        = Random.Range(100, 999);
        damageAction.position        = targetModel.transform.position + new Vector3(0, 2, -2);
        return(damageAction);
    }
Exemplo n.º 5
0
    public void HitValue()
    {
        HitValueAction action = new HitValueAction();

        action.valueTextPrefab = hitValuePrefab;
        action.hitValue        = 1000;
        action.position        = new Vector3(0, 0, -2);


        actionManager.RunAction(action);
    }
Exemplo n.º 6
0
    public void ParallelTest()
    {
        ParallelAction parallel = new ParallelAction();

        parallel.name = "parallel";



        //AnimatorAction action;

        HitValueAction hitAction;

        hitAction = new HitValueAction();
        hitAction.valueTextPrefab = hitValuePrefab;
        hitAction.hitValue        = 999;
        hitAction.position        = new Vector3(0, 2, -2);
        parallel.AddAction(hitAction);

        hitAction = new HitValueAction();
        hitAction.valueTextPrefab = hitValuePrefab;
        hitAction.hitValue        = 888;
        hitAction.position        = new Vector3(1, 1, -2);
        parallel.AddAction(hitAction);

        hitAction = new HitValueAction();
        hitAction.valueTextPrefab = hitValuePrefab;
        hitAction.hitValue        = 777;
        hitAction.position        = new Vector3(2, 0, -2);
        parallel.AddAction(hitAction);


        DelayAction delay = new DelayAction();

        delay.SetDuration(2.0f);
        parallel.AddAction(delay);

        //
        actionManager.RunAction(parallel);
        //action.animator = bat
    }
Exemplo n.º 7
0
    public AnimeAction GetTargetHitDamageAction()
    {
        SequenceAction sequence = new SequenceAction();

        sequence.name = "HitSequence";

        AnimatorAction hitAction = new AnimatorAction();

        hitAction.name         = "enemyHit";
        hitAction.animator     = target;
        hitAction.triggerState = "Hit";
        sequence.AddAction(hitAction);


        HitValueAction damageAction = new HitValueAction();

        damageAction.valueTextPrefab = hitValuePrefab;
        damageAction.hitValue        = 1000;
        damageAction.position        = target.transform.position + new Vector3(0, 1, -2);
        sequence.AddAction(damageAction);

        return(sequence);
    }
Exemplo n.º 8
0
    public AnimeAction CreateCastAction(string name, string vfx, Animator target, int damage)
    {
        SequenceAction sequence = new SequenceAction();

        sequence.name = name;

        Vector3 targetPosition = target.transform.position;

        AnimatorAction animeAction;



        VFXAction vfxAction = new VFXAction();

        vfxAction.name      = "vfxAction";
        vfxAction.vfxName   = vfx;
        vfxAction.position  = targetPosition + new Vector3(0, 0, -2);
        vfxAction.vfxPrefab = vfxPrefab;
        sequence.AddAction(vfxAction);

        animeAction              = new AnimatorAction();
        animeAction.name         = "enemyHit";
        animeAction.animator     = target;
        animeAction.triggerState = "Hit";
        sequence.AddAction(animeAction);


        HitValueAction hitAction = new HitValueAction();

        hitAction.valueTextPrefab = hitValuePrefab;
        hitAction.hitValue        = damage;
        hitAction.position        = targetPosition + new Vector3(0, 1, -2);
        sequence.AddAction(hitAction);

        return(sequence);
    }