feat: particles and new bank

This commit is contained in:
Gerard Gascón 2024-04-18 23:21:03 +02:00
parent 349552674d
commit 60265f3417
220 changed files with 13248 additions and 4917 deletions

View file

@ -0,0 +1,26 @@
using System;
using Presenter;
using UnityEngine;
using Random = UnityEngine.Random;
namespace View.Scene {
public class GrowParticlesSpawner : MonoBehaviour, IRoseGrow {
[SerializeField] private GrowParticle growParticle;
[SerializeField] private Transform growParticlePositions;
[SerializeField, Range(0, 180)] private float angleRange;
public void Grow() {
float randomRotation = Random.Range(-angleRange / 2f, angleRange / 2f);
Instantiate(growParticle, growParticlePositions.position, Quaternion.Euler(0f, 0f, randomRotation));
}
private void OnDrawGizmosSelected() {
Gizmos.color = Color.red;
float angle = angleRange / 2f + 90f;
Vector3 lineOffset = new(Mathf.Cos(angle * Mathf.Deg2Rad), Mathf.Sin(angle * Mathf.Deg2Rad));
Gizmos.DrawLine(growParticlePositions.position, growParticlePositions.position + lineOffset * 5f);
lineOffset = new Vector3(-Mathf.Cos(angle * Mathf.Deg2Rad), Mathf.Sin(angle * Mathf.Deg2Rad));
Gizmos.DrawLine(growParticlePositions.position, growParticlePositions.position + lineOffset * 5f);
}
}
}