Skip to content

Commit

Permalink
Merge pull request #80 from arimger/develop
Browse files Browse the repository at this point in the history
Develop - 0.12.3
  • Loading branch information
arimger committed Jun 17, 2023
2 parents 555c8a4 + c54c2d3 commit b92221b
Show file tree
Hide file tree
Showing 31 changed files with 1,371 additions and 41 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/upm-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Update UPM branch (develop)
on:
push:
branches:
- develop
jobs:
split-upm:
name: split upm branch
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: split upm branch
run: |
git subtree split -P "$PKG_ROOT" -b upm-dev
git push -u origin upm-dev
env:
PKG_ROOT: 'Assets/Editor Toolbox'
12 changes: 12 additions & 0 deletions Assets/Editor Toolbox/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
## 0.12.3 [17.06.2023]

### Changed:
- Fix updating SerializedScene index after deleting Scene
- Fix SerializedScene index calculation
- Fix NRE when deleted Scene was still included in Build Settings
- Fix compilation errors in Unity 2018.x

### Added:
- SceneView extension: better way to select raycasted objects in the Scene view
- LabelWidthAttribute

## 0.12.1 [12.04.2023]

### Changed:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected override void OnGUISafe(Rect position, SerializedProperty property, GU
return;
}

var sceneData = SceneData.GetSceneData(sceneProperty);
var sceneData = SceneData.GetSceneDataFromIndex(property);
var spacing = EditorGUIUtility.standardVerticalSpacing;
position.y += EditorGUIUtility.singleLineHeight + spacing;
if (sceneData.inBuild)
Expand Down Expand Up @@ -82,10 +82,21 @@ private struct SceneData
{
public int index;
public bool enabled;
public GUID guid;
public bool inBuild;

public static SceneData GetSceneData(SerializedProperty property)
public static SceneData GetSceneDataFromIndex(SerializedProperty property)
{
var indexProperty = property.FindPropertyRelative("buildIndex");
var index = indexProperty.intValue;
return new SceneData()
{
index = index,
enabled = index != -1,
inBuild = index != -1
};
}

public static SceneData GetSceneDataFromScene(SerializedProperty property)
{
var sceneData = new SceneData()
{
Expand All @@ -101,7 +112,7 @@ public static SceneData GetSceneData(SerializedProperty property)
for (var i = 0; i < EditorBuildSettings.scenes.Length; i++)
{
var sceneSettings = EditorBuildSettings.scenes[i];
var isEnabled = sceneSettings.enabled;
var isEnabled = sceneSettings.enabled && !string.IsNullOrEmpty(sceneSettings.path);
if (isEnabled)
{
sceneIndex++;
Expand All @@ -112,7 +123,6 @@ public static SceneData GetSceneData(SerializedProperty property)
{
sceneData.index = isEnabled ? sceneIndex : -1;
sceneData.enabled = isEnabled;
sceneData.guid = guid;
sceneData.inBuild = true;
break;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
using UnityEditor;
#if UNITY_2020_2_OR_NEWER
using UnityEditor.AssetImporters;
#else
using UnityEditor.Experimental.AssetImporters;
#endif

namespace Toolbox.Editor.Editors
{
Expand All @@ -15,11 +19,12 @@ public sealed override void OnInspectorGUI()
public virtual void DrawCustomInspector()
{
Drawer.DrawEditor(serializedObject);
#if UNITY_2020_2_OR_NEWER
if (extraDataType != null)
{
Drawer.DrawEditor(extraDataSerializedObject);
}

#endif
ApplyRevertGUI();
}

Expand Down
8 changes: 8 additions & 0 deletions Assets/Editor Toolbox/Editor/SceneView.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b92221b

Please sign in to comment.