public void ObjectMoveAction() { ObjectMoveAction action = new ObjectMoveAction(); action.startPosition = new Vector3(0, 0, zOrderVfx); action.endPosition = new Vector3(-3, -3, zOrderVfx); action.objectPrefab = testObject; action.SetDuration(0.5f); actionManager.RunAction(action); }
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); }
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); }