feat: particles and new bank
This commit is contained in:
parent
349552674d
commit
60265f3417
220 changed files with 13248 additions and 4917 deletions
|
@ -3,6 +3,7 @@ using Domain;
|
|||
using Presenter;
|
||||
using Presenter.SaveSystem;
|
||||
using UnityEngine;
|
||||
using View.Scene;
|
||||
using View.UI;
|
||||
|
||||
namespace View {
|
||||
|
@ -23,7 +24,9 @@ namespace View {
|
|||
|
||||
IRoseSpawner spawner = FindObjectOfType<RoseSpawner>();
|
||||
|
||||
ExpressionClick = new ExpressionClick(Score, inputCollections, spawner);
|
||||
IRoseGrow grow = FindObjectOfType<GrowParticlesSpawner>();
|
||||
|
||||
ExpressionClick = new ExpressionClick(Score, inputCollections, spawner, grow);
|
||||
|
||||
CustomInput = new CustomInput();
|
||||
|
||||
|
|
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
|
|
@ -21,8 +21,6 @@ namespace View.UI {
|
|||
[SerializeField] private Animation growAnimation;
|
||||
[SerializeField] private Animation endAnimation;
|
||||
|
||||
[SerializeField] private ParticleSystem growParticle;
|
||||
|
||||
private void Start() {
|
||||
_click = FindObjectOfType<Dependencies>().ExpressionClick;
|
||||
_customInput = FindObjectOfType<Dependencies>().CustomInput;
|
||||
|
@ -52,8 +50,6 @@ namespace View.UI {
|
|||
if (animator.CurrentAnimation == "Rosa_Grow")
|
||||
animator.PlayUntil(IsLastGrowState(score, growPercentage) ? 1f : growPercentage);
|
||||
|
||||
growParticle.Play();
|
||||
|
||||
text.text = score.ToString();
|
||||
_firstUpdate = false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue