Skip to content

Commit 31028ed

Browse files
git-upm-publisherstarikcetin
authored andcommitted
UPM release 3.0.0
1 parent 13a17e7 commit 31028ed

File tree

68 files changed

+1586
-448
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+1586
-448
lines changed

.assets/generator_menu.png

0 Bytes
Loading

.assets/settings.png

9.4 KB
Loading

.assets/toolbox_disabled.png

10.7 KB
Loading

.assets/toolbox_nowhere.png

11.5 KB
Loading
8.09 KB
Loading

.assets/validation_inspector.png

7.71 KB
Loading

CHANGELOG.md

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

2020

2121

22+
## [3.0.0] - 2023-07-07
23+
24+
This release introduces support for addressable scenes.
25+
26+
There are breaking changes to settings. Please visit the settings page and re-apply all your settings as soon as you update.
27+
28+
### Breaking Changes
29+
- `SceneGuidToPathMapGenerator` is renamed to `SceneDataMapsGenerator`.
30+
- `SceneGuidToPathMapGenerationTriggers` is renamed to `SceneDataMapsGeneratorTriggers`.
31+
- Settings changes:
32+
- Scene GUID to Path Map (new name Scene Data Maps) category:
33+
- The category is renamed from `SceneGuidToPathMap` to `SceneDataMaps`.
34+
- Key of the `GenerationTriggers` setting is changed from `SceneGuidToPathMap.GenerationTriggers` to `SceneDataMaps.GenerationTriggers`.
35+
- Key of the `JsonFormatting` setting is changed from `SceneGuidToPathMap.JsonFormatting` to `SceneDataMaps.JsonFormatting`.
36+
- Key of the `FailBuildIfGenerationFails` setting is changed from `SceneGuidToPathMap.FailBuildIfGenerationFails` to `SceneDataMaps.FailBuildIfGenerationFails`.
37+
- Property Drawer category:
38+
- `ShowInlineSceneInBuildUtility` setting is renamed to `ShowInlineToolbox`. The key is also changed from `PropertyDrawer.ShowInlineSceneInBuildUtility` to `PropertyDrawer.ShowInlineToolbox`.
39+
- All exceptions are moved from the `Eflatun.SceneReference` namespace to the new `Eflatun.SceneReference.Exceptions` namespace.
40+
- Following valiation properties are removed from `SceneReference`. They are instead replaced with a more informative `State` property. See the _Added_ section.
41+
- `IsInSceneGuidToPathMap`: removed.
42+
- `IsInBuildAndEnabled`: removed.
43+
- `IsSafeToUse`: removed.
44+
- `HasValue`: no longer public.
45+
- `SceneReferenceOptionsAttribute` changes:
46+
- `Coloring` field is renamed to `SceneInBuildColoring`. It still controls the same cases of coloring, but they are no longer all the coloring options. See the _Changes_ section.
47+
- `UtilityLine` field is removed. Its replacement is the `Toolbox` field. See the _Added_ section.
48+
49+
### Added
50+
- `SceneDataMapsGenerator` now also generates a scene GUID to address map. The map will be empty if addressables support is disabled.
51+
- New map generation triggers:
52+
- `AfterPackagesResolve`: Triggers after packages are resolved.
53+
- `AfterAddressablesChange`: Triggers after addressable groups change.
54+
- Property drawer can optionally color addressables scenes differently to draw attention to them.
55+
- New inline utilties:
56+
- `Make Addressable`: Makes the scene addressable.
57+
- New settings:
58+
- Addressables Support (`AddressablesSupport`) category:
59+
- `ColorAddressableScenes` setting: If enabled, scene references that have an addressable scene will be colored differently.
60+
- An info box that displays the current addressables support status.
61+
- New exceptions:
62+
- `AddressNotFoundException`
63+
- `AddressNotUniqueException`
64+
- `AddressablesSupportDisabledException`
65+
- `SceneNotAddressableException`
66+
- `SceneGuidToAddressMapProvider` class: Provides a map of scene GUIDs to their address. Very similar to `SceneGuidToPathMapProvider`, with the exception that it cannot provide an inverse map. This is because the address of an asset is not guaranteed to be unique. Instead, it provides `GetGuidFromAddress` and `TryGetGuidFromAddress` methods.
67+
- `SceneReference.FromAddress` factory method: Creates a `SceneReference` from the given address.
68+
- `SceneReference.Address` property.
69+
- `SceneReference.State` property: This property replaces all previously exposed validation methods. It returns a `SceneReferenceState` enum, which describes the state of the `SceneReference` in terms of usage.
70+
- `SceneReferenceState` enum: Describes the state of the `SceneReference` in terms of usage.
71+
- `Unsafe`: The `SceneReference` is not safe to use.
72+
- `Regular`: The `SceneReference` is safe to use, and it references a regular scene.
73+
- `Addressable`: The `SceneReference` is safe to use, and it references an addressable scene. This state is only possible if addressables support is enabled.
74+
- `SceneReferenceOptionsAttribute` new fields:
75+
- `Toolbox`: Controls the visibility of the toolbox button. It replaces the now deleted `UtilityLine` field.
76+
- `AddressableColoring`: Controls the coloring behaviour of the addressable scenes.
77+
- `ToolboxBehaviour` enum. Replaces the now deleted `UtilityLineBehaviour` enum with the same semantics.
78+
79+
### Changed
80+
- The concept of Utility Line is replaced with the concept of Toolbox. In summary, instead of drawing buttons as a second line below the field, we instead draw a small button to the end of the field on the same line. When clicked, a toolbox popup appears with all the utilities.
81+
- `SceneInBuildColoring` argument (previously named `Coloring`) of `SceneReferenceOptionsAttribute` still controls the same types of coloring cases, but since they used to be all the cases, the field was implicitly controlling the entire coloring behaviour. While its semantics are not changed, since there are now other coloring cases, it is no longer the only field that controls the entire coloring behaviour.
82+
83+
84+
2285
## [2.1.0] - 2023-03-01
2386

2487
### Added
@@ -52,6 +115,7 @@ We renamed some of our internal serialized fields. Since we utilize `FormerlySer
52115
- Internal serialized field name changes:
53116
- `SceneReference.sceneAsset` to `SceneReference.asset`
54117
- `SceneReference.sceneAssetGuidHex` to `SceneReference.guid`
118+
- Menu item `Tools/Eflatun/Scene Reference/Run Scene GUID to Path Map Generator` is renamed to `Tools/Eflatun/Scene Reference/Generate Scene Data Maps`.
55119

56120
### Fixed
57121
- Prevent empty scene GUID hex in Unity serialized `SceneReference` instances.

Editor/Eflatun.SceneReference.Editor.asmdef

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
"rootNamespace": "Eflatun.SceneReference.Editor",
44
"references": [
55
"GUID:caca889fed6088d40b22c2d7e2909c31",
6-
"GUID:49818357e697641afb75d2f8acaf1861"
6+
"GUID:49818357e697641afb75d2f8acaf1861",
7+
"GUID:9e24947de15b9834991c9d8411ea37cf",
8+
"GUID:69448af7b92c7f342b298e06a37122aa"
79
],
810
"includePlatforms": [
911
"Editor"
@@ -14,6 +16,17 @@
1416
"precompiledReferences": [],
1517
"autoReferenced": true,
1618
"defineConstraints": [],
17-
"versionDefines": [],
19+
"versionDefines": [
20+
{
21+
"name": "com.unity.addressables",
22+
"expression": "",
23+
"define": "ESR_ADDRESSABLES"
24+
},
25+
{
26+
"name": "com.unity.addressables",
27+
"expression": "[1.0.0,2.0.0)",
28+
"define": "ESR_ADDRESSABLES_1_X_X"
29+
}
30+
],
1831
"noEngineReferences": false
19-
}
32+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#if ESR_ADDRESSABLES
2+
3+
using UnityEditor;
4+
using UnityEditor.AddressableAssets;
5+
using UnityEditor.AddressableAssets.Settings;
6+
7+
namespace Eflatun.SceneReference.Editor.MapGeneratorTriggers
8+
{
9+
[InitializeOnLoad]
10+
internal class AddressablesChangeListener
11+
{
12+
static AddressablesChangeListener()
13+
{
14+
AddressableAssetSettingsDefaultObject.Settings.OnModification += OnAddressablesChange;
15+
}
16+
17+
private static void OnAddressablesChange(AddressableAssetSettings s, AddressableAssetSettings.ModificationEvent e, object o)
18+
{
19+
if (e == AddressableAssetSettings.ModificationEvent.EntryAdded ||
20+
e == AddressableAssetSettings.ModificationEvent.EntryRemoved ||
21+
e == AddressableAssetSettings.ModificationEvent.EntryModified ||
22+
e == AddressableAssetSettings.ModificationEvent.EntryMoved ||
23+
e == AddressableAssetSettings.ModificationEvent.EntryCreated)
24+
{
25+
if (SettingsManager.SceneDataMaps.IsGenerationTriggerEnabled(SceneDataMapsGeneratorTriggers.AfterAddressablesChange))
26+
{
27+
SceneDataMapsGenerator.Run();
28+
}
29+
else
30+
{
31+
Logger.Warn($"Skipping scene data maps generation after addressables changes. It is recommended to enable map generation after addressables changes, as an outdated map can result in broken scene references in runtime. You can enable it in {SettingsManager.SettingsMenuPathForDisplay}.");
32+
}
33+
}
34+
}
35+
}
36+
}
37+
38+
#endif // ESR_ADDRESSABLES

Editor/MapGeneratorTriggers/AddressablesChangeListener.cs.meta

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)