public GameBuilder(GameObject gameObject, ISetting setting, IParticleSpawner particleSpawner, IBlockColorRepository blockColorRepository, List <IGroupPattern> groupPatterns, IBackgroundFactory backgroundFactory, ICameraManager cameraManager, IBlockViewSpawner blockViewSpawner, IFloatingTextRenderer floatingTextRenderer) { gameObject.transform.localScale = new Vector3(setting.ScalePerBlock, setting.ScalePerBlock, 1); setting.Parent = gameObject.transform; setting.ParticleSpawner = particleSpawner; setting.BlockColorRepository = blockColorRepository; setting.FloatingTextRenderer = floatingTextRenderer; _gameObject = gameObject; _setting = setting; _groupPatterns = groupPatterns; _backgroundFactory = backgroundFactory; _cameraManager = cameraManager; _blockViewSpawner = blockViewSpawner; }
IEnumerator CompleteDeleting(float waitTime, IParticleSpawner particleSpawner) { coroutineStarted = true; CreateParticle(particleSpawner); PlaySound(SoundName.Delete); float endTime = Time.time + waitTime; while (endTime > Time.time) { yield return(null); } isDeleting = false; Destroy(gameObject, 0.5f); }
void CreateParticle(IParticleSpawner particleSpawner) { particleSpawner.SpawnParticle(Setting, transform.position, Color); }
IEnumerator CompleteDeleting(float waitTime, IParticleSpawner particleSpawner) { coroutineStarted = true; CreateParticle(particleSpawner); PlaySound(SoundName.Delete); float endTime = Time.time + waitTime; while(endTime > Time.time) { yield return null; } isDeleting = false; Destroy(gameObject, 0.5f); }