2021-01-06 16:10:11 +01:00
|
|
|
using System;
|
|
|
|
using DG.Tweening;
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
[CreateAssetMenu]
|
|
|
|
public class EnemyAppearBehaviour : BaseBulletBehaviour
|
|
|
|
{
|
2021-01-10 16:20:28 +01:00
|
|
|
[SerializeField] private float scaleUpOverBeats = 1;
|
2021-01-06 16:10:11 +01:00
|
|
|
|
2021-01-10 16:20:28 +01:00
|
|
|
private static AudioBeatManager _audio;
|
|
|
|
|
2021-01-06 16:10:11 +01:00
|
|
|
public override void DoBehaviour(Transform bullet, float size, Vector3 pos)
|
|
|
|
{
|
2021-01-10 16:20:28 +01:00
|
|
|
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;
|
2021-01-10 16:20:28 +01:00
|
|
|
|
|
|
|
bullet.DOScale(Vector3.one * size, _audio.TimeBetweenBeats * scaleUpOverBeats).SetEase(Ease.OutQuint);
|
2021-01-06 16:10:11 +01:00
|
|
|
}
|
|
|
|
}
|