Skip to content

Commit

Permalink
UPM release 2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
git-upm-publisher authored and starikcetin committed Mar 1, 2023
1 parent 54b5853 commit 13a17e7
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 10 deletions.
Binary file modified .assets/validation_add_prompt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .assets/validation_enable_prompt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),



## [2.1.0] - 2023-03-01

### Added
- `Open Build Settings` button to the scene-in-build utility popups. This button will ping the scene in the project view and open build settings, allowing you to fix your build settings manually.

### Changed
- `Add to Build as Enabled` button is renamed to `Add to Build` in scene-in-build utility popups of scenes that are not in build.

### Removed
- `Add to Build as Disabled` button in the scene-in-build utility popups of scenes that are not in build. This button was not making much sense because adding to build as disabled doesn't actually fix the situation, since the scene will still be disabled afterwards.



## [2.0.0] - 2023-02-26
We renamed some of our internal serialized fields. Since we utilize `FormerlySerializedAs`, you will not lose any data. However, due to these changes, Unity will re-serialize your `SceneReference`s as you save your scenes and prefabs. Please commit these re-serialization changes as you see fit, otherwise they will keep appearing until you do so.

Expand Down
36 changes: 30 additions & 6 deletions Editor/SceneReferencePropertyDrawer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ private void FixInBuildSettings()
var title = "Add Scene to Build Settings?";
var body = $"Would you like to add the following scene to build settings?\n\n{_path}";

switch (EditorUtility.DisplayDialogComplex(title, body, "Add to Build as Enabled", "Add to Build as Disabled", "Cancel"))
switch (EditorUtility.DisplayDialogComplex(title, body, "Add to Build", "Cancel", "Open Build Settings"))
{
case 0:
{
Expand All @@ -118,8 +118,12 @@ private void FixInBuildSettings()
}
case 1:
{
tempScenes.Add(new EditorBuildSettingsScene(_path, false));
changed = true;
// 1 is cancel
break;
}
case 2:
{
PingAssetAndOpenBuildSettings();
break;
}
}
Expand All @@ -129,10 +133,24 @@ private void FixInBuildSettings()
var title = "Enable Scene in Build Settings?";
var body = $"Would you like to enable the following scene in build settings?\n\n{_path}";

if (EditorUtility.DisplayDialog(title, body, "Enable in Build", "Cancel"))
switch (EditorUtility.DisplayDialogComplex(title, body, "Enable in Build", "Cancel", "Open Build Settings"))
{
tempScenes.Single(x => x.guid.ToString() == _guid).enabled = true;
changed = true;
case 0:
{
tempScenes.Single(x => x.guid.ToString() == _guid).enabled = true;
changed = true;
break;
}
case 1:
{
// 1 is cancel
break;
}
case 2:
{
PingAssetAndOpenBuildSettings();
break;
}
}
}

Expand Down Expand Up @@ -205,5 +223,11 @@ public override float GetPropertyHeight(SerializedProperty property, GUIContent
? EditorGUIUtility.singleLineHeight * 2
: EditorGUIUtility.singleLineHeight;
}

private void PingAssetAndOpenBuildSettings()
{
EditorGUIUtility.PingObject(_asset);
EditorWindow.GetWindow<BuildPlayerWindow>();
}
}
}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ openupm add com.eflatun.scenereference

### With Git URL

Add the following line to the `dependencies` section of your project's `manifest.json` file. Replace `2.0.0` with the version you want to install.
Add the following line to the `dependencies` section of your project's `manifest.json` file. Replace `2.1.0` with the version you want to install.

```json
"com.eflatun.scenereference": "git+https://github.com/starikcetin/Eflatun.SceneReference.git#2.0.0"
"com.eflatun.scenereference": "git+https://github.com/starikcetin/Eflatun.SceneReference.git#2.1.0"
```

_Although it is highly discouraged, you can replace `2.0.0` with `upm` to get the latest version instead of a specific one._
_Although it is highly discouraged, you can replace `2.1.0` with `upm` to get the latest version instead of a specific one._

## Ignore Auto-Generated Map File in Version Control

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.eflatun.scenereference",
"version": "2.0.0",
"version": "2.1.0",
"displayName": "Eflatun.SceneReference",
"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",
"documentationUrl": "https://github.com/starikcetin/Eflatun.SceneReference/blob/main/README.md",
Expand Down

0 comments on commit 13a17e7

Please sign in to comment.