Exemple #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);
    }
    public AnimeAction CreateEffectAction(BattleModel targetModel, AnimationClip hitEffect)
    {
        SimpleAnimationAction effectAction = new SimpleAnimationAction();

        effectAction.clip          = hitEffect;
        effectAction.spawnPosition = targetModel.transform.position + new Vector3(0, 1, -2);

        return(effectAction);
    }
Exemple #3
0
    public void SimpleAnime()
    {
        SimpleAnimationAction action = new SimpleAnimationAction();

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

        actionManager.RunAction(action);
    }
Exemple #4
0
    public AnimeAction CreateProjectileAction(Vector3 startPos, Vector3 targetPos)
    {
        ObjectMoveAction projectAction = new ObjectMoveAction();

        projectAction.startPosition = startPos + new Vector3(0, 0, zOrderVfx);;
        projectAction.endPosition   = targetPos + new Vector3(0, 1, zOrderVfx);
        projectAction.objectPrefab  = projectilePrefab;
        projectAction.SetDuration(0.5f);

        SimpleAnimationAction explodeAction = new SimpleAnimationAction();

        explodeAction.clip          = explodeEffect;
        explodeAction.spawnPosition = targetPos + new Vector3(0, 0, zOrderVfx);
        explodeAction.repeat        = 1;

        SequenceAction fullFireAction = new SequenceAction();

        fullFireAction.AddAction(projectAction);
        fullFireAction.AddAction(explodeAction);

        return(fullFireAction);
    }
Exemple #5
0
    public void CastProjectile()
    {
        // Using ObjectMove
        ObjectMoveAction projectAction = new ObjectMoveAction();

        projectAction.startPosition = player.GetLaunchPosition() + new Vector3(0, 0, zOrderVfx);;
        projectAction.endPosition   = enemyAnimator.transform.position + new Vector3(0, 1, zOrderVfx);
        projectAction.objectPrefab  = projectilePrefab;
        projectAction.SetDuration(0.5f);

        SimpleAnimationAction explodeAction = new SimpleAnimationAction();

        explodeAction.clip          = animeClip;
        explodeAction.spawnPosition = enemyAnimator.transform.position + new Vector3(0, 0, zOrderVfx);
        explodeAction.repeat        = 1;

        SequenceAction fullFireAction = new SequenceAction();

        fullFireAction.AddAction(projectAction);
        fullFireAction.AddAction(explodeAction);

        // Using MoveAction
        // MoveAction moveAction = new MoveAction();
        // moveAction.startPosition = player.GetLaunchPosition();
        // moveAction.endPosition = enemyAnimator.transform.position + new Vector3(0, 1, 0);
        // moveAction.targetObject = testObject;
        // moveAction.SetDuration(0.5f);

        AnimatorAction animeAction = new AnimatorAction();

        animeAction.name         = "character";
        animeAction.animator     = charAnimator;
        animeAction.triggerState = "Cast";
        animeAction.onHitAction  = fullFireAction;

        actionManager.RunAction(animeAction);
    }