Skip to content

Commit c94f1c9

Browse files
git-upm-publisherstarikcetin
authored andcommitted
UPM release 3.1.1
1 parent a66a2df commit c94f1c9

File tree

7 files changed

+55
-11
lines changed

7 files changed

+55
-11
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1919

2020

2121

22+
## [3.1.1] - 2023-07-22
23+
24+
### Fixed
25+
- Implemented workaround for a Unity bug that caused our settings page to throw exceptions and not display in Unity `2022.3.4f1`.
26+
27+
28+
2229
## [3.1.0] - 2023-07-08
2330

2431
### Added

Editor/AssemblyInfo.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
using UnityEngine.Scripting;
1+
using System.Runtime.CompilerServices;
2+
using UnityEngine.Scripting;
3+
4+
[assembly: InternalsVisibleTo("Eflatun.SceneReference.DevelopmentUtils.Editor")]
25

36
// Always link to make sure InitializeOnLoad methods don't get stripped away
47
[assembly: AlwaysLinkAssembly]

Editor/SceneDataMapsGeneratorTriggers.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
namespace Eflatun.SceneReference.Editor
55
{
6+
// IMPORTANT: Keep SceneDataMapsGeneratorTriggers and InternalSceneDataMapsGeneratorTriggers in sync at all times.
7+
68
/// <summary>
79
/// Identifiers for places that trigger <see cref="SceneDataMapsGenerator"/>.
810
/// </summary>
@@ -19,4 +21,17 @@ public enum SceneDataMapsGeneratorTriggers
1921
AfterPackagesResolve = 1 << 3,
2022
AfterAddressablesChange = 1 << 4,
2123
}
24+
25+
/// <summary>
26+
/// Same as <see cref="SceneDataMapsGeneratorTriggers"/>, but without the <c>All</c> and <c>None</c> values.
27+
/// </summary>
28+
[Flags]
29+
internal enum InternalSceneDataMapsGeneratorTriggers
30+
{
31+
AfterSceneAssetChange = 1 << 0,
32+
BeforeEnterPlayMode = 1 << 1,
33+
BeforeBuild = 1 << 2,
34+
AfterPackagesResolve = 1 << 3,
35+
AfterAddressablesChange = 1 << 4,
36+
}
2237
}

Editor/SettingsManager.cs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using UnityEditor;
66
using UnityEditor.SettingsManagement;
77
using Newtonsoft.Json;
8+
using UnityEngine;
89

910
namespace Eflatun.SceneReference.Editor
1011
{
@@ -60,7 +61,7 @@ public static class SceneDataMaps
6061
/// <inheritdoc cref="SettingsManager"/>
6162
/// </remarks>
6263
/// <seealso cref="IsGenerationTriggerEnabled"/>
63-
[field: UserSetting(CategoryName, "Generation Triggers", "Controls when the scene data maps get regenerated.\n\n• AAfter Scene Asset Change: Regenerate the maps every time a scene asset changes (delete, create, move, rename).\n\n• Before Enter Play Mode: Regenerate the maps before entering play mode in the editor.\n\n• Before Build: Regenerate the maps before a build.\n\n• After Packages Resolve: Regenerate the maps after UPM packages are resolved.\n\n• After Addressables Change: Regenerate the maps after addressable group entries change. Only relevant if you have addressables support enabled.\n\nIt is recommended that you leave this option at 'All' unless you are debugging something. Failure to generate the maps when needed can result in broken scene references in runtime.\n\nNote: 'All' and 'Everything' are the same thing. They both represent all triggers.")]
64+
[field: UserSetting]
6465
public static ProjectSetting<SceneDataMapsGeneratorTriggers> GenerationTriggers { get; }
6566
= new ProjectSetting<SceneDataMapsGeneratorTriggers>("SceneDataMaps.GenerationTriggers", SceneDataMapsGeneratorTriggers.All);
6667

@@ -90,6 +91,24 @@ public static class SceneDataMaps
9091
/// <seealso cref="GenerationTriggers"/>
9192
public static bool IsGenerationTriggerEnabled(SceneDataMapsGeneratorTriggers trigger) =>
9293
GenerationTriggers.value.IncludesFlag(trigger);
94+
95+
[UserSettingBlock(CategoryName)]
96+
private static void Draw(string searchContext)
97+
{
98+
// Draw GenerationTriggers field.
99+
{
100+
var oldPublic = GenerationTriggers.value;
101+
var oldInternal = (InternalSceneDataMapsGeneratorTriggers)oldPublic;
102+
var label = new GUIContent("Generation Triggers", "Controls when the scene data maps get regenerated.\n\n• After Scene Asset Change: Regenerate the maps every time a scene asset changes (delete, create, move, rename).\n\n• Before Enter Play Mode: Regenerate the maps before entering play mode in the editor.\n\n• Before Build: Regenerate the maps before a build.\n\n• After Packages Resolve: Regenerate the maps after UPM packages are resolved.\n\n• After Addressables Change: Regenerate the maps after addressable group entries change. Only relevant if you have addressables support enabled.\n\nIt is recommended that you leave this option at 'All' unless you are debugging something. Failure to generate the maps when needed can result in broken scene references in runtime.\n\nNote: 'All' and 'Everything' are the same thing. They both represent all triggers.");
103+
var newInternal = EditorGUILayout.EnumFlagsField(label, oldInternal);
104+
SettingsGUILayout.DoResetContextMenuForLastRect(GenerationTriggers);
105+
var newPublic = (SceneDataMapsGeneratorTriggers)newInternal;
106+
if (newPublic != oldPublic)
107+
{
108+
GenerationTriggers.value = newPublic;
109+
}
110+
}
111+
}
93112
}
94113

95114
/// <summary>

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@
2020
<br>
2121

2222
<p align="center">
23-
<a href="https://github.com/starikcetin/Eflatun.SceneReference/"><img src="https://img.shields.io/static/v1?label=GitHub&logo=github&message=Eflatun.SceneReference&color=blueviolet" alt="GitHub badge"/></a>
23+
<a href="https://github.com/starikcetin/Eflatun.SceneReference/"><img src="https://img.shields.io/static/v1?color=6243c4&label=GitHub&message=Eflatun.SceneReference" alt="GitHub badge"/></a>
2424
&nbsp;
25-
<a href="https://openupm.com/packages/com.eflatun.scenereference/"><img src="https://img.shields.io/npm/v/com.eflatun.scenereference?label=OpenUPM&logo=unity&registry_uri=https://package.openupm.com" alt="OpenUPM badge"/></a>
25+
<a href="https://openupm.com/packages/com.eflatun.scenereference/"><img src="https://img.shields.io/npm/v/com.eflatun.scenereference?color=6243c4&label=OpenUPM&registry_uri=https://package.openupm.com" alt="OpenUPM badge"/></a>
26+
&nbsp;
27+
<a href="https://openupm.com/packages/com.eflatun.scenereference/"><img src="https://img.shields.io/badge/dynamic/json?color=6243c4&label=Downloads&suffix=/month&query=$.downloads&url=https://package.openupm.com/Downloads/point/last-month/com.eflatun.scenereference" alt="Monthly downloads badge"/></a>
2628
</p>
2729
<br>
2830

@@ -46,13 +48,13 @@ openupm add com.eflatun.scenereference
4648

4749
### With Git URL
4850

49-
Add the following line to the `dependencies` section of your project's `manifest.json` file. Replace `3.1.0` with the version you want to install.
51+
Add the following line to the `dependencies` section of your project's `manifest.json` file. Replace `3.1.1` with the version you want to install.
5052

5153
```json
52-
"com.eflatun.scenereference": "git+https://github.com/starikcetin/Eflatun.SceneReference.git#3.1.0"
54+
"com.eflatun.scenereference": "git+https://github.com/starikcetin/Eflatun.SceneReference.git#3.1.1"
5355
```
5456

55-
_Although it is highly discouraged, you can replace `3.1.0` with `upm` to get the latest version instead of a specific one._
57+
_Although it is highly discouraged, you can replace `3.1.1` with `upm` to get the latest version instead of a specific one._
5658

5759
## Ignore Auto-Generated Map Files in Version Control
5860

Runtime/AssemblyInfo.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
using System.Runtime.CompilerServices;
22
using UnityEngine.Scripting;
33

4-
// Make internals visible to the Editor assembly
54
[assembly: InternalsVisibleTo("Eflatun.SceneReference.Editor")]
6-
7-
// Make internals visible to the runtime tests assembly
85
[assembly: InternalsVisibleTo("Eflatun.SceneReference.Tests.Runtime")]
6+
[assembly: InternalsVisibleTo("Eflatun.SceneReference.DevelopmentUtils.Editor")]
97

108
// Always link to make sure RuntimeInitializeOnLoadMethod methods don't get stripped away
119
[assembly: AlwaysLinkAssembly]

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "com.eflatun.scenereference",
3-
"version": "3.1.0",
3+
"version": "3.1.1",
44
"displayName": "Eflatun.SceneReference",
55
"description": "Scene References for Runtime and Editor. Strongly typed, robust, and reliable. Provides Asset GUID, Scene Path, Build Index, and Scene Name.\nhttps://github.com/starikcetin/Eflatun.SceneReference",
66
"documentationUrl": "https://github.com/starikcetin/Eflatun.SceneReference/blob/main/README.md",

0 commit comments

Comments
 (0)