protected virtual void Start() { m_cannonBall = FindObjectOfType <CannonBall>(); m_cannonBall.OnAcceleration += (accelerator) => { StopCoroutine(m_rotationCoroutine); }; m_cannonBall.OnAccelerationStopped += () => { m_rotationCoroutine = StartCoroutine(rotateObjects()); }; LevelGenerator.GetLevelGenerator().OnGenerate += () => { m_generatedObjects = LevelGenerator.GetLevelGenerator().GetGeneratedObjectsWithName(m_objectName); if (m_generatedObjects.Count == 0) { Destroy(this); } m_rotationCoroutine = StartCoroutine(rotateObjects()); }; }
private void Start() { _instance = this; LevelGenerator.GetLevelGenerator().OnGenerate += () => StartCleaning(LevelGenerator.GetLevelGenerator().GeneratedObjects); }