feat: particles and new bank
This commit is contained in:
parent
349552674d
commit
60265f3417
220 changed files with 13248 additions and 4917 deletions
15
Assets/Scripts/View/Scene/GrowParticle.cs
Normal file
15
Assets/Scripts/View/Scene/GrowParticle.cs
Normal file
|
@ -0,0 +1,15 @@
|
|||
using System;
|
||||
using Presenter;
|
||||
using UnityEngine;
|
||||
using Animator = FramedAnimator.Animator;
|
||||
|
||||
namespace View.Scene {
|
||||
public class GrowParticle : MonoBehaviour {
|
||||
[SerializeField] private Animator animator;
|
||||
|
||||
private void Start() {
|
||||
animator.OnAnimationEnd += _ => Destroy(gameObject);
|
||||
animator.PlayUntil(1f);
|
||||
}
|
||||
}
|
||||
}
|
3
Assets/Scripts/View/Scene/GrowParticle.cs.meta
Normal file
3
Assets/Scripts/View/Scene/GrowParticle.cs.meta
Normal file
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c22bc0b51046461fa4028a91ea32f73c
|
||||
timeCreated: 1713469874
|
26
Assets/Scripts/View/Scene/GrowParticlesSpawner.cs
Normal file
26
Assets/Scripts/View/Scene/GrowParticlesSpawner.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
3
Assets/Scripts/View/Scene/GrowParticlesSpawner.cs.meta
Normal file
3
Assets/Scripts/View/Scene/GrowParticlesSpawner.cs.meta
Normal file
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: eb8eb037cd4e4a6c882f7276a0b9d91c
|
||||
timeCreated: 1713473715
|
Loading…
Add table
Add a link
Reference in a new issue