Skip to content

Commit

Permalink
[v0.0.6] Added dependencies; Fix for unloading
Browse files Browse the repository at this point in the history
  • Loading branch information
g0dzZz-coder committed Jan 26, 2024
1 parent bc82cb7 commit 802275d
Show file tree
Hide file tree
Showing 19 changed files with 32 additions and 12 deletions.
3 changes: 3 additions & 0 deletions Runtime/Definitions.meta

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
Expand Up @@ -5,7 +5,7 @@
using UnityEngine;
using static Depra.Scenes.Module;

namespace Depra.Scenes
namespace Depra.Scenes.Definitions
{
[CreateAssetMenu(fileName = FILE_NAME, menuName = MENU_PATH + FILE_NAME, order = DEFAULT_ORDER)]
public sealed class SceneDatabase : ScriptableObject
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using UnityEngine;
using UnityEngine.SceneManagement;

namespace Depra.Scenes
namespace Depra.Scenes.Definitions
{
[Serializable]
public sealed partial class SceneDefinition
Expand Down
File renamed without changes.
3 changes: 3 additions & 0 deletions Runtime/Exceptions.meta

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
Expand Up @@ -3,7 +3,7 @@

using System;

namespace Depra.Scenes
namespace Depra.Scenes.Exceptions
{
internal sealed class UnexpectedSceneSwitch : Exception
{
Expand Down
File renamed without changes.
3 changes: 3 additions & 0 deletions Runtime/Operations.meta

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
Expand Up @@ -6,9 +6,10 @@
using System.Threading;
using System.Threading.Tasks;
using Depra.Loading.Operations;
using Depra.Scenes.Definitions;
using UnityEngine.SceneManagement;

namespace Depra.Scenes
namespace Depra.Scenes.Operations
{
public sealed class SceneLoadingOperation : ILoadingOperation
{
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
using System.Threading;
using System.Threading.Tasks;
using Depra.Loading.Operations;
using Depra.Scenes.Definitions;
using UnityEngine.SceneManagement;

namespace Depra.Scenes
namespace Depra.Scenes.Operations
{
public sealed class SceneUnloadingOperation : ILoadingOperation
{
Expand Down
File renamed without changes.
3 changes: 3 additions & 0 deletions Runtime/Services.meta

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

3 changes: 2 additions & 1 deletion Runtime/ISceneChange.cs → Runtime/Services/ISceneChange.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
using System.Threading;
using System.Threading.Tasks;
using Depra.Loading.Operations;
using Depra.Scenes.Definitions;

namespace Depra.Scenes
namespace Depra.Scenes.Services
{
public interface ISceneChange
{
Expand Down
File renamed without changes.
11 changes: 6 additions & 5 deletions Runtime/SceneChange.cs → Runtime/Services/SceneChange.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
// SPDX-License-Identifier: Apache-2.0
// © 2023-2024 Nikolay Melnikov <[email protected]>

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Depra.Loading.Curtain;
using Depra.Loading.Operations;
using Depra.Scenes.Definitions;
using Depra.Scenes.Exceptions;
using Depra.Scenes.Operations;
using UnityEngine.SceneManagement;

namespace Depra.Scenes
namespace Depra.Scenes.Services
{
public sealed class SceneChange : ISceneChange
{
Expand Down Expand Up @@ -47,9 +49,8 @@ Task ISceneChange.Load(SceneDefinition scene, IEnumerable<ILoadingOperation> add

async Task ISceneChange.Unload(SceneDefinition scene, CancellationToken token)
{
var operations = new[] { new SceneLoadingOperation(scene, OperationDescription.Default(scene.Name)) };
ILoadingCurtain cleanCurtain = new CleanLoadingCurtain();
await cleanCurtain.Load(operations, token);
var operations = new[] { new SceneUnloadingOperation(scene, OperationDescription.Default(scene.Name)) };
await new CleanLoadingCurtain().Load(operations, token);
}

Task ISceneChange.Reload(IEnumerable<ILoadingOperation> addOperations, CancellationToken token) =>
Expand Down
File renamed without changes.
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
{
"name": "com.depra.scenes",
"version": "0.0.5",
"version": "0.0.6",
"displayName": "Depra.Scenes",
"description": "",
"unity": "2022.3",
"license": "Apache-2.0",
"dependencies": {
"com.depra.loading.unity": "0.0.5",
"com.depra.inspector.unity": "0.0.5"
},
"keywords": [
"depra",
"unity",
Expand Down

0 comments on commit 802275d

Please sign in to comment.