public void VFXAction() { VFXAction action = new VFXAction(); action.name = "vfxAction"; action.vfxName = "Thunder"; action.position = new Vector3(0, 0, -2); action.vfxPrefab = vfxPrefab; actionManager.RunAction(action); //action.animator = bat }
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); }