JOLT/Assets/Scripts/Manager/Spawner/Spawner.cs
/// <summary>
/// Called by the timer when the timer's interval is up.
/// </summary>
Called by the timer when the timer's interval is up.
Called by the timer when the timer ' s interval is up .
private void SpawnObjectAndResetTimerDuration() {
            SpawnObjectAtPosition(GeneratePositionToSpawn());
            ResetTimerDuration();
            #region Local_Function
            Vector2 GeneratePositionToSpawn() {
                Vector2 directionToSpawn = (new Vector2(Random.Range(-1f, 1f), Random.Range(-1f, 1f))).normalized;
                return (directionToSpawn * screenSize) + (additionalSpawnDistance * directionToSpawn);
            }
            void ResetTimerDuration() {
                spawnTimer.ResetTimer(spawnInterval.GenerateWaitingTime());
            }
            #endregion
        }
private void SpawnObjectAndResetTimerDuration ( ) { SpawnObjectAtPosition ( GeneratePositionToSpawn ( ) ) ; ResetTimerDuration ( ) ; region  Local_Function Vector2 GeneratePositionToSpawn ( ) { Vector2 directionToSpawn = ( new Vector2 ( Random . Range ( - 1f , 1f ) , Random . Range ( - 1f , 1f ) ) ) . normalized ; return ( directionToSpawn * screenSize ) + ( additionalSpawnDistance * directionToSpawn ) ; } void ResetTimerDuration ( ) { spawnTimer . ResetTimer ( spawnInterval . GenerateWaitingTime ( ) ) ; } endregion }
Called by the timer when the timer's interval is up.
Called by the timer when the timer ' s interval is up .