Skip to content

Commit

Permalink
CHANGE: Wrapped OnValidate in editor only tags.
Browse files Browse the repository at this point in the history
  • Loading branch information
VulpesSoftware committed Mar 10, 2023
1 parent cba63f5 commit 33b583e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this package will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [2.0.2] - 2023-03-10
### Changed
- Wrapped OnValidate in editor only tags for MenuHandler and MenuWidget_Slider.

## [2.0.1] - 2023-01-31
### Changed
- Updated Transitions Package dependency from 1.0.3 to 1.0.4.
Expand Down
3 changes: 2 additions & 1 deletion Scripts/Runtime/MenuHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ public bool CursorLocked
/// </summary>
public IMenuModal Modal { get; private set; }

#if UNITY_EDITOR
protected override void OnValidate()
{
base.OnValidate();
switch (initialScreen)
{
case IMenuLoading:
Expand All @@ -89,6 +89,7 @@ protected override void OnValidate()
break;
}
}
#endif

protected override void Awake()
{
Expand Down
3 changes: 2 additions & 1 deletion Scripts/Runtime/Widgets/MenuWidget_Slider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,15 @@ public void Initialize(string header, int value, int minValue, int maxValue, int
this.stepValue = stepValue;
}

#if UNITY_EDITOR
protected override void OnValidate()
{
base.OnValidate();
if (minValue > maxValue)
{
minValue = maxValue;
}
}
#endif

protected override void Awake()
{
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "com.vulpes.menus",
"displayName": "Vulpes Menu Framework",
"version": "2.0.1",
"version": "2.0.2",
"unity": "2021.3",
"description": "The Vulpes Menu Framework is a Promise driven menu system that serves as a companion to Unity\u2019s built-in UI system.",
"keywords": [
Expand All @@ -18,7 +18,7 @@
"com.unity.ugui": "1.0.0",
"com.unity.textmeshpro": "3.0.6",
"com.unity.inputsystem": "1.3.0",
"com.vulpes.transitions": "1.0.4",
"com.vulpes.transitions": "1.0.5",
"com.vulpes.promises": "2.1.1"
},
"samples": [
Expand Down

0 comments on commit 33b583e

Please sign in to comment.