-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
## [0.0.2] - 2022-05-23 | ||
Minor UX updates and bug fixes. | ||
|
||
### Added | ||
- More logging which shows that a scene is being currently loaded. | ||
- Methods to access in `loadingCollection` and `loadedCollection` in `ScriptableSceneController`. | ||
- Exposed `IsLoading` property in `ScriptableSceneController`. | ||
|
||
### Changed | ||
- Updated Scene Manager Window to support reordering and to provide more info. | ||
- Improved component UX via `AddComponentMenu`. | ||
|
||
### Fixed | ||
- Incorrect collection progress being reported when a collection is loading. | ||
|
||
## [0.0.1] - 2022-05-21 | ||
Initial preview version. | ||
|
||
### Added | ||
- `ScriptableScene` - wrapper `ScriptableObject` for `SceneAsset`, which allows referencing scenes without needing to hard-code scene name, path or build index. Click on _Assets > Create > CHARK > Scriptable Scenes > Scriptable Scene_ to create. | ||
- `ScriptableSceneCollection` - container for `ScriptableScene` and is useful to load a set of scenes at once (`SetupScene`, `UIScene`, `GameplayScene`, etc). Click on _Assets > Create > CHARK > Scriptable Scenes > Scriptable Scene Collection_ to create. | ||
- `ScriptableSceneTransition` - `ScriptableObject` that can be used to inject scene transitions. | ||
- `FadeScriptableSceneTransition` - built-in transition which simply fades a canvas in and out (via `FadeCanvas`) during scene loading. | ||
- `FadeCanvas` - built-in component which takes care of actually fading the canvas and subscribing to a `ScriptableSceneTransition`. | ||
- `ScriptableSceneManagerWindow` - Editor Window which can be used to quickly open a set of scene in Edit and also Play mode. Click on _Window > CHARK > Scriptable Scenes > Scriptable Scene Manager_ to open. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Documentation | ||
Work in progress :( |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"name": "CHARK.ScriptableScenes.Editor", | ||
"rootNamespace": "CHARK.ScriptableScenes", | ||
"references": [ | ||
"GUID:7cfa357a9d1c66644b9ddbad9d55c0a3" | ||
], | ||
"includePlatforms": [ | ||
"Editor" | ||
], | ||
"excludePlatforms": [], | ||
"allowUnsafeCode": false, | ||
"overrideReferences": false, | ||
"precompiledReferences": [], | ||
"autoReferenced": true, | ||
"defineConstraints": [], | ||
"versionDefines": [], | ||
"noEngineReferences": false | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using CHARK.ScriptableScenes.PropertyAttributes; | ||
using UnityEditor; | ||
using UnityEngine; | ||
|
||
namespace CHARK.ScriptableScenes.Editor.PropertyDrawers | ||
{ | ||
[CustomPropertyDrawer(typeof(ReadOnlyAttribute))] | ||
internal class ReadOnlyPropertyDrawer : PropertyDrawer | ||
{ | ||
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) | ||
{ | ||
var isEnabled = GUI.enabled; | ||
GUI.enabled = false; | ||
EditorGUI.PropertyField(position, property, label, true); | ||
GUI.enabled = isEnabled; | ||
} | ||
|
||
public override float GetPropertyHeight(SerializedProperty property, GUIContent label) | ||
{ | ||
return EditorGUI.GetPropertyHeight(property, label, true); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
using System.Linq; | ||
using CHARK.ScriptableScenes.Editor.Utilities; | ||
using UnityEditor; | ||
using UnityEngine; | ||
|
||
namespace CHARK.ScriptableScenes.Editor | ||
{ | ||
/// <summary> | ||
/// Custom inspector for <see cref="ScriptableSceneCollection"/>, used to draw debug buttons. | ||
/// </summary> | ||
[CanEditMultipleObjects] | ||
[CustomEditor(typeof(BaseScriptableSceneCollection), true)] | ||
internal class SceneReferenceCollectionEditor : UnityEditor.Editor | ||
{ | ||
#region Private Fields | ||
|
||
private BaseScriptableSceneCollection sceneCollection; | ||
|
||
#endregion | ||
|
||
#region Unity Lifecycle | ||
|
||
private void OnEnable() | ||
{ | ||
sceneCollection = (BaseScriptableSceneCollection) target; | ||
} | ||
|
||
public override void OnInspectorGUI() | ||
{ | ||
base.OnInspectorGUI(); | ||
|
||
EditorGUILayout.Space(); | ||
|
||
ScriptableSceneGUI.LabelField("Controls", EditorStyles.boldLabel); | ||
DrawControls(sceneCollection); | ||
} | ||
|
||
#endregion | ||
|
||
#region Private Methods | ||
|
||
private static void DrawControls(BaseScriptableSceneCollection collection) | ||
{ | ||
var isAddedScenes = collection.Scenes.Any(); | ||
var isEnabled = GUI.enabled; | ||
|
||
EditorGUILayout.BeginHorizontal(); | ||
|
||
GUI.enabled = isEnabled && isAddedScenes && Application.isPlaying == false; | ||
DrawOpenButton(collection); | ||
DrawPlayButton(collection); | ||
|
||
GUI.enabled = isEnabled && isAddedScenes && Application.isPlaying; | ||
DrawLoadButton(collection); | ||
|
||
EditorGUILayout.EndHorizontal(); | ||
|
||
GUI.enabled = isEnabled; | ||
} | ||
|
||
private static void DrawOpenButton(BaseScriptableSceneCollection collection) | ||
{ | ||
if (ScriptableSceneGUI.Button("Open")) | ||
{ | ||
collection.Open(); | ||
} | ||
} | ||
|
||
private static void DrawPlayButton(BaseScriptableSceneCollection collection) | ||
{ | ||
if (ScriptableSceneGUI.Button("Play")) | ||
{ | ||
collection.Play(); | ||
} | ||
} | ||
|
||
private static void DrawLoadButton(BaseScriptableSceneCollection collection) | ||
{ | ||
if (ScriptableSceneGUI.Button("Load")) | ||
{ | ||
collection.Load(); | ||
} | ||
} | ||
|
||
#endregion | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.