lucid-super-dream/Assets/Scripts/EnemyAppearBehaviour.cs

22 lines
623 B
C#
Raw Normal View History

2021-01-06 16:10:11 +01:00
using System;
using DG.Tweening;
using UnityEngine;
[CreateAssetMenu]
public class EnemyAppearBehaviour : BaseBulletBehaviour
{
[SerializeField] private float scaleUpOverBeats = 1;
2021-01-06 16:10:11 +01:00
private static AudioBeatManager _audio;
2021-01-06 16:10:11 +01:00
public override void DoBehaviour(Transform bullet, float size, Vector3 pos)
{
if (_audio == null)
_audio = FindObjectOfType<AudioBeatManager>();
2021-01-06 16:10:11 +01:00
bullet.localScale = Vector3.zero;
2021-01-10 15:56:55 +01:00
bullet.localPosition = pos;
bullet.DOScale(Vector3.one * size, _audio.TimeBetweenBeats * scaleUpOverBeats).SetEase(Ease.OutQuint);
2021-01-06 16:10:11 +01:00
}
}