Skip to content

Commit

Permalink
📦 0.2.1 Update
Browse files Browse the repository at this point in the history
🎨 Asset Changes
- Commented all scripts in a uniform way.
- Updated the URP extension package to have some cleaner code and a requirement for a camera on the same object as the script.
- Remove legacy 0.1.x header comments where they were missed in the last update.
  • Loading branch information
JonathanMCarter committed Oct 10, 2022
1 parent cc59cb1 commit a5b54b9
Show file tree
Hide file tree
Showing 35 changed files with 533 additions and 235 deletions.
50 changes: 36 additions & 14 deletions Editor/Custom Editors/Inspectors/SceneGroupEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@
namespace CarterGames.Experimental.MultiScene.Editor
{
/// <summary>
/// Custom Inspector for the SceneGroup scriptable object..
/// Custom Inspector for the SceneGroup scriptable object.
/// </summary>
[CustomEditor(typeof(SceneGroup))]
public sealed class SceneGroupEditor : UnityEditor.Editor
{

/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
{ Fields }
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────── */
/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
| Fields
───────────────────────────────────────────────────────────────────────────────────────────────────────────── */

private SerializedProperty groupIndex;
private SerializedProperty group;
Expand All @@ -33,9 +32,9 @@ public sealed class SceneGroupEditor : UnityEditor.Editor
private string[] allGroupOptions;
private string[] buildSettingsOptions;

/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
{ Unity Methods }
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────── */
/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
| Unity Methods
───────────────────────────────────────────────────────────────────────────────────────────────────────────── */

private void OnEnable()
{
Expand Down Expand Up @@ -85,9 +84,9 @@ public override void OnInspectorGUI()
serializedObject.Update();
}

/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
{ Draw Methods }
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────── */
/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
| Draw Methods
───────────────────────────────────────────────────────────────────────────────────────────────────────────── */

/// <summary>
/// Renders the title section of the editor...
Expand All @@ -102,6 +101,9 @@ private static void DrawSceneGroupTitle()
}


/// <summary>
/// Draws the script field for this editor.
/// </summary>
private void DrawScriptSection()
{
GUILayout.Space(4.5f);
Expand All @@ -117,6 +119,9 @@ private void DrawScriptSection()
}


/// <summary>
/// Draws a help box with some important info to show.
/// </summary>
private void DrawHelpBox()
{
EditorGUILayout.BeginVertical();
Expand All @@ -125,6 +130,9 @@ private void DrawHelpBox()
}


/// <summary>
/// Shows the meta data section of the group.
/// </summary>
private void DrawMetaData()
{
GUILayout.Space(1.5f);
Expand Down Expand Up @@ -153,6 +161,9 @@ private void DrawMetaData()
}


/// <summary>
/// Draws the tool buttons section.
/// </summary>
private void DrawToolsSection()
{
GUILayout.Space(1.5f);
Expand All @@ -174,6 +185,9 @@ private void DrawToolsSection()
}


/// <summary>
/// Draws the scene field section.
/// </summary>
private void DrawScenesSection()
{
GUILayout.Space(1.5f);
Expand Down Expand Up @@ -220,6 +234,9 @@ private void DrawScenesSection()
}


/// <summary>
/// Draws the danger zone section.
/// </summary>
private void DrawDangerZoneSection()
{
GUILayout.Space(1.5f);
Expand Down Expand Up @@ -358,6 +375,7 @@ private void CallAddNewAdditiveScene(SerializedProperty prop, int i)
scenes.GetArrayElementAtIndex(scenes.arraySize - 1).FindPropertyRelative("isInBuildSettings").boolValue = false;
}


/// <summary>
/// Adds a new element to the scenes list that is blank.
/// </summary>
Expand All @@ -371,6 +389,7 @@ private void CallAddNewAdditiveScene()
scenes.serializedObject.Update();
}


/// <summary>
/// Resets the scenes list to a new list.
/// </summary>
Expand All @@ -385,6 +404,9 @@ private void CallResetGroup()
}


/// <summary>
/// Loads the scene group in the editor on call.
/// </summary>
private void LoadSceneGroupInEditor()
{
var _sceneList = new List<string>();
Expand Down Expand Up @@ -417,9 +439,9 @@ private void LoadSceneGroupInEditor()
MultiSceneEditorEvents.SceneGroups.OnSceneGroupLoadedInEditor.Raise();
}

/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
{ Utility Methods }
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────── */
/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
| Utility Methods
───────────────────────────────────────────────────────────────────────────────────────────────────────────── */

private void RefreshCategoryOptions()
{
Expand Down
19 changes: 9 additions & 10 deletions Editor/Custom Editors/Inspectors/SettingsAssetEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ namespace CarterGames.Experimental.MultiScene.Editor
[CustomEditor(typeof(MultiSceneSettingsAsset))]
public sealed class SettingsAssetEditor : UnityEditor.Editor
{

/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
{ Fields }
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────── */
/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
| Fields
───────────────────────────────────────────────────────────────────────────────────────────────────────────── */

private SerializedProperty loadModeProp;
private SerializedProperty startGroupProp;
Expand All @@ -29,9 +28,9 @@ public sealed class SettingsAssetEditor : UnityEditor.Editor

private Color defaultBackgroundColor;

/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
{ Unity Methods }
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────── */
/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
| Unity Methods
───────────────────────────────────────────────────────────────────────────────────────────────────────────── */

private void OnEnable()
{
Expand Down Expand Up @@ -78,9 +77,9 @@ private void OnSettingUpdate()
Repaint();
}

/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
{ Drawer Methods }
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────── */
/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
| Drawer Methods
───────────────────────────────────────────────────────────────────────────────────────────────────────────── */

/// <summary>
/// Draws the script fields in the custom inspector...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,22 @@

namespace CarterGames.Experimental.MultiScene.Editor
{
/// <summary>
/// Draws a group category in a single row for each of use.
/// </summary>
[CustomPropertyDrawer(typeof(DefaultGroupCategory))]
public class DefaultGroupCategoryDrawer : PropertyDrawer
public sealed class DefaultGroupCategoryDrawer : PropertyDrawer
{

/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
{ Fields }
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────── */
/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
| Fields
───────────────────────────────────────────────────────────────────────────────────────────────────────────── */

private static SerializedProperty _nameProp;
private static SerializedProperty _indexProp;

/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
{ Drawer Methods }
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────── */
/* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
| Drawer Method
───────────────────────────────────────────────────────────────────────────────────────────────────────────── */

public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
Expand Down
Loading

0 comments on commit a5b54b9

Please sign in to comment.