diff --git a/Assets/Prefabs/Bullet.prefab b/Assets/Prefabs/Bullet.prefab index 88db7d1..5fd6eaf 100644 --- a/Assets/Prefabs/Bullet.prefab +++ b/Assets/Prefabs/Bullet.prefab @@ -26,7 +26,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1738226812227614583} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 1726.4172, y: 488.75378, z: 274.96027} + m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} diff --git a/Assets/Scenes/Chief's Sandbox.unity b/Assets/Scenes/Chief's Sandbox.unity index 2d0a048..ea0ce81 100644 --- a/Assets/Scenes/Chief's Sandbox.unity +++ b/Assets/Scenes/Chief's Sandbox.unity @@ -234,7 +234,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 186457103} m_LocalRotation: {x: -0, y: 1, z: -0, w: 0} - m_LocalPosition: {x: 0, y: -2, z: 30} + m_LocalPosition: {x: 0, y: -2, z: 100} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} @@ -274,9 +274,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 4f8399031f014bee928b07d26fe8ee4c, type: 3} m_Name: m_EditorClassIdentifier: - pauseOnBeat: 16 - pauseLengthInBeats: 0 - beatOffset: 2 + spawnOnBeat: 1 + xMin: -5 + xMax: 5 --- !u!114 &531937975 stripped MonoBehaviour: m_CorrespondingSourceObject: {fileID: 5076175860835241000, guid: 1f82f952c53fc7449a0091cf29ba3def, type: 3} diff --git a/Assets/Scripts/BeatSpawner.cs b/Assets/Scripts/BeatSpawner.cs index c42614f..6ca18f7 100644 --- a/Assets/Scripts/BeatSpawner.cs +++ b/Assets/Scripts/BeatSpawner.cs @@ -1,17 +1,17 @@ using System; using UnityEngine; using UnityEngine.Scripting; +using Random = UnityEngine.Random; public class BeatSpawner : ShootInputBase { - [SerializeField] private int pauseOnBeat; - [SerializeField] private int pauseLengthInBeats; - [SerializeField] private int beatOffset; + [SerializeField] private int spawnOnBeat = 2; + [SerializeField] private float xMin = -10; + [SerializeField] private float xMax = 10; private AudioBeatManager _audio; private bool _shoot; - private bool _isPaused = false; private void Awake() { @@ -20,13 +20,9 @@ public class BeatSpawner : ShootInputBase public void OnBeat(int beat) { - if ((beat + beatOffset) % pauseOnBeat == 0) - _isPaused = true; - - if ((beat + beatOffset + pauseLengthInBeats) % pauseOnBeat == 0) - _isPaused = false; - - _shoot = !_isPaused; + _shoot = beat % spawnOnBeat == 0; + if (_shoot) + transform.position = new Vector3(Random.Range(xMin, xMax), transform.position.y, transform.position.z); } public override bool IsShooting() diff --git a/Assets/Scripts/EnemyAppearBehaviour.cs b/Assets/Scripts/EnemyAppearBehaviour.cs index c8e4da6..d4e04a1 100644 --- a/Assets/Scripts/EnemyAppearBehaviour.cs +++ b/Assets/Scripts/EnemyAppearBehaviour.cs @@ -5,14 +5,18 @@ using UnityEngine; [CreateAssetMenu] public class EnemyAppearBehaviour : BaseBulletBehaviour { - [SerializeField] private float scaleUpDuration = 0.3f; - [SerializeField] private float scaleUpDelay = 0.2f; + [SerializeField] private float scaleUpOverBeats = 1; + private static AudioBeatManager _audio; + public override void DoBehaviour(Transform bullet, float size, Vector3 pos) { + if (_audio == null) + _audio = FindObjectOfType(); + bullet.localScale = Vector3.zero; bullet.localPosition = pos; - DOTween.Sequence() - .Insert(scaleUpDelay, bullet.DOScale(Vector3.one * size, scaleUpDuration).SetEase(Ease.OutQuint)); + + bullet.DOScale(Vector3.one * size, _audio.TimeBetweenBeats * scaleUpOverBeats).SetEase(Ease.OutQuint); } } \ No newline at end of file diff --git a/Assets/Scripts/Weapon.cs b/Assets/Scripts/Weapon.cs index e7c94c9..097171e 100644 --- a/Assets/Scripts/Weapon.cs +++ b/Assets/Scripts/Weapon.cs @@ -256,8 +256,8 @@ public class Weapon : ScriptableObject { var b = _bulletTransforms[i]; if (b == null) continue; - Gizmos.DrawSphere(b.position, b.localScale.x/2f * bulletSize.EvaluateMinMaxCurve()); - Gizmos.DrawSphere(_bullets[i].PrevPos, b.localScale.x/2f * bulletSize.EvaluateMinMaxCurve()); + Gizmos.DrawSphere(b.position, b.localScale.x/2f ); + Gizmos.DrawSphere(_bullets[i].PrevPos, b.localScale.x/2f ); Gizmos.DrawLine(b.position, _bullets[i].PrevPos); } diff --git a/Assets/Weapons/Enemy.asset b/Assets/Weapons/Enemy.asset index 8ae942c..a6d8824 100644 --- a/Assets/Weapons/Enemy.asset +++ b/Assets/Weapons/Enemy.asset @@ -108,17 +108,17 @@ MonoBehaviour: zone: numToSpawn: 10 offset: {x: 0, y: 0, z: 0} - spawnType: 0 + spawnType: 2 spawnDir: 0 spawnPlane: 1 width: 0 height: 0 - surfaceOnly: 0 + surfaceOnly: 1 evenDistribution: 0 - numSides: 5 - numPerSide: 10 + numSides: 3 + numPerSide: 5 flipVertical: 0 - radius: 10 + radius: 5 arc: 360 composite: [] manualFire: 1 diff --git a/Assets/Weapons/PlayerWeapon.asset b/Assets/Weapons/PlayerWeapon.asset index 9eb67b3..5f26453 100644 --- a/Assets/Weapons/PlayerWeapon.asset +++ b/Assets/Weapons/PlayerWeapon.asset @@ -12,7 +12,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 2bc932693ed0a470d9cf39b1c3168afb, type: 3} m_Name: PlayerWeapon m_EditorClassIdentifier: - fireRate: 0.05 + fireRate: 0.025 bulletSpeed: m_Mode: 0 m_CurveMultiplier: 1 @@ -106,20 +106,20 @@ MonoBehaviour: m_Bits: 128 accuracy: 2 zone: - numToSpawn: 1 + numToSpawn: 2 offset: {x: 0, y: 0, z: 0} - spawnType: 0 + spawnType: 1 spawnDir: 0 spawnPlane: 1 - width: 0 + width: 1.5 height: 0 surfaceOnly: 1 evenDistribution: 1 - numSides: 3 + numSides: 2 numPerSide: 5 flipVertical: 1 - radius: 1.25 - arc: 360 + radius: 5.47 + arc: 82 composite: [] manualFire: 0 behaviour: {fileID: 11400000, guid: 20de5bc0e86bc4037a85f6c46356a227, type: 2}