refactor: moved grow animation to its own class
This commit is contained in:
parent
150b602dc3
commit
779af276d3
14 changed files with 224 additions and 116 deletions
|
@ -4,18 +4,16 @@ using UnityEngine;
|
|||
using Random = UnityEngine.Random;
|
||||
|
||||
namespace View.Scene {
|
||||
public class GrowParticlesSpawner : MonoBehaviour, IRoseGrow {
|
||||
public class GrowParticlesSpawner : MonoBehaviour, IInputCallback {
|
||||
[SerializeField] private GrowParticle growParticle;
|
||||
[SerializeField] private Transform growParticlePositions;
|
||||
[SerializeField, Range(0, 180)] private float angleRange;
|
||||
|
||||
public void Grow() {
|
||||
public void OnInputReceived() {
|
||||
float randomRotation = Random.Range(-angleRange / 2f, angleRange / 2f);
|
||||
Instantiate(growParticle, growParticlePositions.position, Quaternion.Euler(0f, 0f, randomRotation));
|
||||
}
|
||||
|
||||
public void GrowStep() { }
|
||||
|
||||
private void OnDrawGizmosSelected() {
|
||||
Gizmos.color = Color.red;
|
||||
float angle = angleRange / 2f + 90f;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue