feat: Roses spawn
This commit is contained in:
		
							parent
							
								
									ff2d68ed07
								
							
						
					
					
						commit
						f8a29f1501
					
				
					 206 changed files with 12637 additions and 19 deletions
				
			
		| 
						 | 
				
			
			@ -1,11 +1,22 @@
 | 
			
		|||
using System;
 | 
			
		||||
using Presenter;
 | 
			
		||||
using UnityEngine;
 | 
			
		||||
using Random = UnityEngine.Random;
 | 
			
		||||
 | 
			
		||||
namespace View {
 | 
			
		||||
	public class RoseSpawner : MonoBehaviour {
 | 
			
		||||
	public class RoseSpawner : MonoBehaviour, IRoseSpawner {
 | 
			
		||||
		[SerializeField] private Rect spawnerRegion;
 | 
			
		||||
		[SerializeField] private GameObject rose;
 | 
			
		||||
 | 
			
		||||
		public void SpawnRose() {
 | 
			
		||||
			Vector2 spawnPos = new(
 | 
			
		||||
				spawnerRegion.position.x + Random.Range(-spawnerRegion.size.x / 2f, spawnerRegion.size.x / 2f),
 | 
			
		||||
				spawnerRegion.position.y + Random.Range(-spawnerRegion.size.y / 2f, spawnerRegion.size.y / 2f)
 | 
			
		||||
			);
 | 
			
		||||
 | 
			
		||||
			Instantiate(rose, spawnPos, Quaternion.identity);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		private void OnDrawGizmos() {
 | 
			
		||||
			Gizmos.DrawWireCube(spawnerRegion.position, spawnerRegion.size);
 | 
			
		||||
		}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue