Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LevelSystem now has a method that emits a signal assigned in the insp… #8

Merged
merged 1 commit into from
Jan 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion Assets/TirUtilities/Runtime/LevelManagment/LevelSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace TirUtilities.LevelManagment
///
/// Author : Devon Wilson
/// Created: May 05, 2021
/// Updated: Sep 22, 2021
/// Updated: Jan 09, 2022
/// -->
/// <summary>
/// Handles the loading of <see cref="LevelData"/> emitted from <see cref="LevelLoadSignal"/>
Expand Down Expand Up @@ -50,6 +50,8 @@ public class LevelSystem : MonoBehaviour
private List<LevelLoadSignal> _levelLoadSignals;
[Tooltip("Emitted when the level loader finishes."), SerializeField]
private Signal _loadCompleteSignal;
[SerializeField]
private LevelLoadSignal _mainMenuLoadSignal;

#endregion

Expand Down Expand Up @@ -139,6 +141,20 @@ private void LevelLoadSignalReceicer(LevelData levelData)

#endregion

#region Load Methods

/// <summary> Emits the main menu load signal if one is assigned. </summary>
/// <returns><c>false</c> if the main menu load signal is null. Otherwise <c>true</c>.</returns>
public bool TryLoadMainMenu()
{
if (_mainMenuLoadSignal.IsNull()) return false;

_mainMenuLoadSignal.Emit();
return true;
}

#endregion

#region Public Properties

public static LevelSystem Instance => _Instance;
Expand Down
1 change: 1 addition & 0 deletions Documentation/manual/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- Setting the patch version in the export tool creates a version file.
- <code>LevelSystem</code> now has a method, <code>TryLoadMainMenu</code>, that emits a signal assigned in the inspector.

### Changed

Expand Down