net.dreditor.freetimesurfacing 0.0.0-stage → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.attestation.p7m +0 -0
- package/DREditor.FreeTimeSurfacing.asmdef +27 -0
- package/DREditor.FreeTimeSurfacing.asmdef.meta +7 -0
- package/FTEGameSceneSurface.cs +48 -0
- package/FTEGameSceneSurface.cs.meta +11 -0
- package/FTEPurchaseCompleteHandler.cs +64 -0
- package/FTEPurchaseCompleteHandler.cs.meta +11 -0
- package/FTESurfaceComponent.cs +10 -0
- package/FTESurfaceComponent.cs.meta +2 -0
- package/FTESurfaceManager.cs +49 -0
- package/FTESurfaceManager.cs.meta +2 -0
- package/FTESurfaceSelectionListener.cs +45 -0
- package/FTESurfaceSelectionListener.cs.meta +2 -0
- package/FTESurfaceUpdatableVisibility.cs +64 -0
- package/FTESurfaceUpdatableVisibility.cs.meta +2 -0
- package/IFTESurfaceManager.cs +30 -0
- package/IFTESurfaceManager.cs.meta +2 -0
- package/InitializeFTESurfacingInput.cs +38 -0
- package/InitializeFTESurfacingInput.cs.meta +2 -0
- package/InitializeLoadingFTESurfacing.cs +198 -0
- package/InitializeLoadingFTESurfacing.cs.meta +11 -0
- package/LeaveFTESurfacing.cs +162 -0
- package/LeaveFTESurfacing.cs.meta +2 -0
- package/Samples~/DRE_FTEMinigames.unity +649 -0
- package/Samples~/DRE_FTEMinigames.unity.meta +7 -0
- package/Samples~/FTESurfaceInputAllowed.asset +21 -0
- package/Samples~/FTESurfaceInputAllowed.asset.meta +8 -0
- package/Samples~/FTE_Buffered_Selected_UI_Cacher.prefab +137 -0
- package/Samples~/FTE_Buffered_Selected_UI_Cacher.prefab.meta +7 -0
- package/Samples~/FTE_Controls_Callable_UI.prefab +51 -0
- package/Samples~/FTE_Controls_Callable_UI.prefab.meta +7 -0
- package/Samples~/FTE_Minigame_Surface_ETemplate.prefab +48 -0
- package/Samples~/FTE_Minigame_Surface_ETemplate.prefab.meta +7 -0
- package/Samples~/FTE_Surface_Canvas_Shell.prefab +253 -0
- package/Samples~/FTE_Surface_Canvas_Shell.prefab.meta +7 -0
- package/Samples~/FTE_Surface_Canvas_Template.prefab +333 -0
- package/Samples~/FTE_Surface_Canvas_Template.prefab.meta +7 -0
- package/Samples~/FTE_Surface_Manager_Shell.prefab +52 -0
- package/Samples~/FTE_Surface_Manager_Shell.prefab.meta +7 -0
- package/Samples~/FTE_Surface_Manager_Template.prefab +411 -0
- package/Samples~/FTE_Surface_Manager_Template.prefab.meta +7 -0
- package/Samples~/FTE_Surface_System_Shell.prefab +602 -0
- package/Samples~/FTE_Surface_System_Shell.prefab.meta +7 -0
- package/Samples~/FTE_Surface_System_Template.prefab +360 -0
- package/Samples~/FTE_Surface_System_Template.prefab.meta +7 -0
- package/Samples~/FTE_Tutorial_Callable_UI.prefab +51 -0
- package/Samples~/FTE_Tutorial_Callable_UI.prefab.meta +7 -0
- package/Samples~/Initialize_Loading_FTE_Surfacing.prefab +145 -0
- package/Samples~/Initialize_Loading_FTE_Surfacing.prefab.meta +7 -0
- package/Samples~/Layered_Focused_Carousel_Shell.prefab +169 -0
- package/Samples~/Layered_Focused_Carousel_Shell.prefab.meta +7 -0
- package/Samples~/Layered_Focused_Carousel_Template.prefab +856 -0
- package/Samples~/Layered_Focused_Carousel_Template.prefab.meta +7 -0
- package/Samples~/OnCantPurchase.asset +15 -0
- package/Samples~/OnCantPurchase.asset.meta +8 -0
- package/Samples~/OnPurchase.asset +15 -0
- package/Samples~/OnPurchase.asset.meta +8 -0
- package/Samples~/OnPurchaseCompleted.asset +15 -0
- package/Samples~/OnPurchaseCompleted.asset.meta +8 -0
- package/Samples~/PaidAmount.asset +21 -0
- package/Samples~/PaidAmount.asset.meta +8 -0
- package/Samples~/Shift_On_Updated_FTE_Surfaces.prefab +46 -0
- package/Samples~/Shift_On_Updated_FTE_Surfaces.prefab.meta +7 -0
- package/ShiftOnUpdatedFTESurfaces.cs +23 -0
- package/ShiftOnUpdatedFTESurfaces.cs.meta +2 -0
- package/SubmittableFTESurfaceCollection.cs +110 -0
- package/SubmittableFTESurfaceCollection.cs.meta +2 -0
- package/SubmittableFTESurfaceComponent.cs +36 -0
- package/SubmittableFTESurfaceComponent.cs.meta +2 -0
- package/package.json +48 -4
- package/package.json.meta +7 -0
- package/README.md +0 -3
package/.attestation.p7m
ADDED
|
Binary file
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "DREditor.FreeTimeSurfacing",
|
|
3
|
+
"rootNamespace": "",
|
|
4
|
+
"references": [
|
|
5
|
+
"Unity.InputSystem",
|
|
6
|
+
"Unity.TextMeshPro",
|
|
7
|
+
"DREditor",
|
|
8
|
+
"DREditor.Audio",
|
|
9
|
+
"DREditor.Fading",
|
|
10
|
+
"DREditor.EventObjectServices",
|
|
11
|
+
"DREditor.RoomLoading",
|
|
12
|
+
"DREditor.UI",
|
|
13
|
+
"DREditor.UIHandling",
|
|
14
|
+
"DREditor.Presents",
|
|
15
|
+
"DREditor.TextDisplaying",
|
|
16
|
+
"DREditor.ItemRolling"
|
|
17
|
+
],
|
|
18
|
+
"includePlatforms": [],
|
|
19
|
+
"excludePlatforms": [],
|
|
20
|
+
"allowUnsafeCode": false,
|
|
21
|
+
"overrideReferences": false,
|
|
22
|
+
"precompiledReferences": [],
|
|
23
|
+
"autoReferenced": true,
|
|
24
|
+
"defineConstraints": [],
|
|
25
|
+
"versionDefines": [],
|
|
26
|
+
"noEngineReferences": false
|
|
27
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using DREditor.Fading;
|
|
3
|
+
using DREditor.Processables;
|
|
4
|
+
using DREditor.Services;
|
|
5
|
+
using System;
|
|
6
|
+
using System.Collections;
|
|
7
|
+
using UnityEngine;
|
|
8
|
+
using UnityEngine.SceneManagement;
|
|
9
|
+
|
|
10
|
+
namespace DREditor.FreeTimeSurfacing
|
|
11
|
+
{
|
|
12
|
+
/// <summary>
|
|
13
|
+
///
|
|
14
|
+
/// </summary>
|
|
15
|
+
[ClassHeader(nameof(FTESurfaceComponent) + ", " + nameof(ISubmittable) +
|
|
16
|
+
"\n\n")]
|
|
17
|
+
public class FTEGameSceneSurface : FTESurfaceComponent, ISubmittable
|
|
18
|
+
{
|
|
19
|
+
/// <summary>
|
|
20
|
+
///
|
|
21
|
+
/// </summary>
|
|
22
|
+
[Tooltip("")]
|
|
23
|
+
[SerializeField] protected string gameScene = "";
|
|
24
|
+
|
|
25
|
+
/// <summary>
|
|
26
|
+
///
|
|
27
|
+
/// </summary>
|
|
28
|
+
[Tooltip("")]
|
|
29
|
+
[SerializeField] protected float fadeOutDuration = 0.5f;
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
/// <inheritdoc/>
|
|
33
|
+
public virtual void Submit(Action onComplete) => StartCoroutine(MoveToScene());
|
|
34
|
+
|
|
35
|
+
/// <summary>
|
|
36
|
+
///
|
|
37
|
+
/// </summary>
|
|
38
|
+
protected virtual IEnumerator MoveToScene()
|
|
39
|
+
{
|
|
40
|
+
if (ServiceLocator.HasService(out GlobalFade fader))
|
|
41
|
+
yield return fader.FadeToRoutine(fadeOutDuration);
|
|
42
|
+
|
|
43
|
+
UnityEngine.Debug.LogWarning("REPORT: CHANGING SCENE");
|
|
44
|
+
|
|
45
|
+
SceneManager.LoadScene(gameScene);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using DREditor.EventObjects;
|
|
3
|
+
using DREditor.Processables;
|
|
4
|
+
using DREditor.Services;
|
|
5
|
+
using DREditor.Utility;
|
|
6
|
+
using UnityEngine;
|
|
7
|
+
using UnityEngine.Events;
|
|
8
|
+
|
|
9
|
+
namespace DREditor.FreeTimeSurfacing
|
|
10
|
+
{
|
|
11
|
+
/// <summary>
|
|
12
|
+
///
|
|
13
|
+
/// </summary>
|
|
14
|
+
[ClassHeader(nameof(SceneEventListener) +
|
|
15
|
+
"\n\n")]
|
|
16
|
+
public class FTEPurchaseCompleteHandler : SceneEventListener
|
|
17
|
+
{
|
|
18
|
+
/// <summary>
|
|
19
|
+
///
|
|
20
|
+
/// </summary>
|
|
21
|
+
[Header("")]
|
|
22
|
+
[Divider]
|
|
23
|
+
[Tooltip("")]
|
|
24
|
+
[SerializeField] protected SceneEvent onPurchaseCompleted = null;
|
|
25
|
+
|
|
26
|
+
[Header("")]
|
|
27
|
+
public UnityEvent onSurfacePurchaseCompleted;
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
/// <inheritdoc/>
|
|
31
|
+
protected override void OnResponseInvoked()
|
|
32
|
+
{
|
|
33
|
+
base.OnResponseInvoked();
|
|
34
|
+
|
|
35
|
+
OnPurchased();
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/// <summary>
|
|
39
|
+
///
|
|
40
|
+
/// </summary>
|
|
41
|
+
protected virtual void OnPurchased() =>
|
|
42
|
+
ServiceLocator.GetService<IFTESurfaceManager>()
|
|
43
|
+
.GetSelectedSurface()
|
|
44
|
+
.InvokeThisAs<ISubmittable>(InvokeSubmitableComponent);
|
|
45
|
+
|
|
46
|
+
/// <summary>
|
|
47
|
+
///
|
|
48
|
+
/// </summary>
|
|
49
|
+
/// <param name="submitable"></param>
|
|
50
|
+
protected virtual void InvokeSubmitableComponent(ISubmittable submitable) =>
|
|
51
|
+
submitable.Submit(onComplete: OnPurchaseCompleted);
|
|
52
|
+
|
|
53
|
+
/// <summary>
|
|
54
|
+
///
|
|
55
|
+
/// </summary>
|
|
56
|
+
protected virtual void OnPurchaseCompleted()
|
|
57
|
+
{
|
|
58
|
+
onSurfacePurchaseCompleted?.Invoke();
|
|
59
|
+
|
|
60
|
+
if (onPurchaseCompleted != null)
|
|
61
|
+
onPurchaseCompleted.Raise();
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using DREditor;
|
|
3
|
+
using DREditor.Services;
|
|
4
|
+
using DREditor.UI;
|
|
5
|
+
using System.Collections.Generic;
|
|
6
|
+
using UnityEngine;
|
|
7
|
+
|
|
8
|
+
namespace DREditor.FreeTimeSurfacing
|
|
9
|
+
{
|
|
10
|
+
/// <summary>
|
|
11
|
+
///
|
|
12
|
+
/// </summary>
|
|
13
|
+
[ClassHeader(nameof(ServiceHolder<IFTESurfaceManager>) + " for type: " + nameof(IFTESurfaceManager) +
|
|
14
|
+
"\n\n")]
|
|
15
|
+
public class FTESurfaceManager : ServiceHolder<IFTESurfaceManager>, IFTESurfaceManager
|
|
16
|
+
{
|
|
17
|
+
/// <summary>
|
|
18
|
+
///
|
|
19
|
+
/// </summary>
|
|
20
|
+
[Tooltip("")]
|
|
21
|
+
[SerializeField] protected IndexSelector surfaceMover = null;
|
|
22
|
+
|
|
23
|
+
/// <summary>
|
|
24
|
+
///
|
|
25
|
+
/// </summary>
|
|
26
|
+
[Tooltip("")]
|
|
27
|
+
[SerializeField] protected List<FTESurfaceComponent> surfaces = new();
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
protected virtual void Start() => surfaceMover.SelectionMaximum = surfaces.Count - 1;
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
/// <inheritdoc/>
|
|
34
|
+
public virtual FTESurfaceComponent GetSurfaceAt(int index) => surfaces[index];
|
|
35
|
+
|
|
36
|
+
/// <inheritdoc/>
|
|
37
|
+
public virtual FTESurfaceComponent GetSelectedSurface() => surfaces[surfaceMover.SelectedIndex];
|
|
38
|
+
|
|
39
|
+
/// <inheritdoc/>
|
|
40
|
+
public virtual bool TryGetSelectionHandler<T>(out T value) => (value = GetSelectionHandler<T>()) != null;
|
|
41
|
+
|
|
42
|
+
/// <summary>
|
|
43
|
+
///
|
|
44
|
+
/// </summary>
|
|
45
|
+
/// <typeparam name="T"></typeparam>
|
|
46
|
+
/// <returns></returns>
|
|
47
|
+
private T GetSelectionHandler<T>() => surfaceMover is T output ? output : default;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using DREditor.Services;
|
|
3
|
+
using DREditor.UI;
|
|
4
|
+
|
|
5
|
+
namespace DREditor.FreeTimeSurfacing
|
|
6
|
+
{
|
|
7
|
+
/// <summary>
|
|
8
|
+
///
|
|
9
|
+
/// </summary>
|
|
10
|
+
public abstract class FTESurfaceSelectionListener : TrackedIndexListener
|
|
11
|
+
{
|
|
12
|
+
/// <summary>
|
|
13
|
+
///
|
|
14
|
+
/// </summary>
|
|
15
|
+
protected IFTESurfaceManager surfaceService;
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
/// <summary>
|
|
19
|
+
///
|
|
20
|
+
/// </summary>
|
|
21
|
+
/// <returns></returns>
|
|
22
|
+
protected override bool InitializedSelector() => ServiceValid() && ServiceHasSelectorType();
|
|
23
|
+
|
|
24
|
+
/// <summary>
|
|
25
|
+
///
|
|
26
|
+
/// </summary>
|
|
27
|
+
/// <returns></returns>
|
|
28
|
+
protected virtual bool ServiceValid()
|
|
29
|
+
{
|
|
30
|
+
bool result = ServiceLocator.HasService(out surfaceService);
|
|
31
|
+
|
|
32
|
+
if (!result)
|
|
33
|
+
UnityEngine.Debug.LogError($"ALERT: A {nameof(IFTESurfaceManager)} Service is not available! " +
|
|
34
|
+
$"REPORT: Disabling detection for when a surface is selected!");
|
|
35
|
+
|
|
36
|
+
return result;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/// <summary>
|
|
40
|
+
///
|
|
41
|
+
/// </summary>
|
|
42
|
+
/// <returns></returns>
|
|
43
|
+
protected virtual bool ServiceHasSelectorType() => surfaceService.TryGetSelectionHandler(out selector);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using DREditor.Processables;
|
|
3
|
+
using DREditor.UIHandling;
|
|
4
|
+
using UnityEngine;
|
|
5
|
+
|
|
6
|
+
namespace DREditor.FreeTimeSurfacing
|
|
7
|
+
{
|
|
8
|
+
/// <summary>
|
|
9
|
+
///
|
|
10
|
+
/// </summary>
|
|
11
|
+
[ClassHeader(nameof(FTESurfaceComponent) + ", " + nameof(ISurfacable) +
|
|
12
|
+
"\n\n")]
|
|
13
|
+
public class FTESurfaceUpdatableVisibility : FTESurfaceComponent, ISurfacable
|
|
14
|
+
{
|
|
15
|
+
/// <summary>
|
|
16
|
+
///
|
|
17
|
+
/// </summary>
|
|
18
|
+
[Tooltip("")]
|
|
19
|
+
[SerializeField] protected UIVisibilityComponent uiDisplayComponent = null;
|
|
20
|
+
|
|
21
|
+
/// <summary>
|
|
22
|
+
///
|
|
23
|
+
/// </summary>
|
|
24
|
+
[Tooltip("")]
|
|
25
|
+
[SerializeField] protected bool swap = false;
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
/// <inheritdoc/>
|
|
29
|
+
public virtual void StartUp()
|
|
30
|
+
{
|
|
31
|
+
if (!swap)
|
|
32
|
+
Show();
|
|
33
|
+
else
|
|
34
|
+
Hide();
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/// <inheritdoc/>
|
|
38
|
+
public virtual void Close()
|
|
39
|
+
{
|
|
40
|
+
if (!swap)
|
|
41
|
+
Hide();
|
|
42
|
+
else
|
|
43
|
+
Show();
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/// <summary>
|
|
47
|
+
///
|
|
48
|
+
/// </summary>
|
|
49
|
+
protected virtual void Show()
|
|
50
|
+
{
|
|
51
|
+
if (uiDisplayComponent != null)
|
|
52
|
+
uiDisplayComponent.Show();
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/// <summary>
|
|
56
|
+
///
|
|
57
|
+
/// </summary>
|
|
58
|
+
protected virtual void Hide()
|
|
59
|
+
{
|
|
60
|
+
if (uiDisplayComponent != null)
|
|
61
|
+
uiDisplayComponent.Hide();
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
namespace DREditor.FreeTimeSurfacing
|
|
3
|
+
{
|
|
4
|
+
/// <summary>
|
|
5
|
+
///
|
|
6
|
+
/// </summary>
|
|
7
|
+
public interface IFTESurfaceManager
|
|
8
|
+
{
|
|
9
|
+
/// <summary>
|
|
10
|
+
///
|
|
11
|
+
/// </summary>
|
|
12
|
+
/// <param name="index"></param>
|
|
13
|
+
/// <returns></returns>
|
|
14
|
+
FTESurfaceComponent GetSurfaceAt(int index);
|
|
15
|
+
|
|
16
|
+
/// <summary>
|
|
17
|
+
///
|
|
18
|
+
/// </summary>
|
|
19
|
+
/// <returns></returns>
|
|
20
|
+
FTESurfaceComponent GetSelectedSurface();
|
|
21
|
+
|
|
22
|
+
/// <summary>
|
|
23
|
+
///
|
|
24
|
+
/// </summary>
|
|
25
|
+
/// <typeparam name="T"></typeparam>
|
|
26
|
+
/// <param name="value"></param>
|
|
27
|
+
/// <returns></returns>
|
|
28
|
+
bool TryGetSelectionHandler<T>(out T value);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using DREditor.EventObjects;
|
|
3
|
+
using UnityEngine;
|
|
4
|
+
|
|
5
|
+
namespace DREditor.FreeTimeSurfacing
|
|
6
|
+
{
|
|
7
|
+
/// <summary>
|
|
8
|
+
///
|
|
9
|
+
/// </summary>
|
|
10
|
+
[ClassHeader(nameof(SetInputOnSceneEvent) + ", " + nameof(SceneEventListener) +
|
|
11
|
+
"\n\n")]
|
|
12
|
+
public class InitializeFTESurfacingInput : SetInputOnSceneEvent
|
|
13
|
+
{
|
|
14
|
+
/// <summary>
|
|
15
|
+
///
|
|
16
|
+
/// </summary>
|
|
17
|
+
[Header("")]
|
|
18
|
+
[Divider]
|
|
19
|
+
[Tooltip("")]
|
|
20
|
+
[SerializeField] protected bool whenDestroyedSetInput = false;
|
|
21
|
+
|
|
22
|
+
/// <summary>
|
|
23
|
+
///
|
|
24
|
+
/// </summary>
|
|
25
|
+
[Tooltip("")]
|
|
26
|
+
[SerializeField] protected bool debugStart = false;
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
protected virtual void Start()
|
|
30
|
+
{
|
|
31
|
+
if (debugStart)
|
|
32
|
+
Event.Raise();
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
protected virtual void OnDestroy() => SetInputStates(whenDestroyedSetInput);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using DREditor;
|
|
3
|
+
using DREditor.Dialogues;
|
|
4
|
+
using DREditor.Dialogues.Finishing;
|
|
5
|
+
using DREditor.EventObjects;
|
|
6
|
+
using DREditor.Fading;
|
|
7
|
+
using DREditor.Services;
|
|
8
|
+
using System.Collections;
|
|
9
|
+
using UnityEngine;
|
|
10
|
+
|
|
11
|
+
namespace DREditor.FreeTimeSurfacing
|
|
12
|
+
{
|
|
13
|
+
/// <summary>
|
|
14
|
+
///
|
|
15
|
+
/// </summary>
|
|
16
|
+
[ClassHeader("")]
|
|
17
|
+
public class InitializeLoadingFTESurfacing : MonoBehaviour
|
|
18
|
+
{
|
|
19
|
+
/// <summary>
|
|
20
|
+
///
|
|
21
|
+
/// </summary>
|
|
22
|
+
[Tooltip("")]
|
|
23
|
+
[SerializeField] protected BoolWithEvent hasMenuAccess = null;
|
|
24
|
+
|
|
25
|
+
/// <summary>
|
|
26
|
+
///
|
|
27
|
+
/// </summary>
|
|
28
|
+
[Tooltip("")]
|
|
29
|
+
[SerializeField] protected BoolWithEvent onFTEMinigame = null;
|
|
30
|
+
|
|
31
|
+
/// <summary>
|
|
32
|
+
///
|
|
33
|
+
/// </summary>
|
|
34
|
+
[Tooltip("")]
|
|
35
|
+
[SerializeField] protected BoolWithEvent observeModeLocked = null;
|
|
36
|
+
|
|
37
|
+
/// <summary>
|
|
38
|
+
///
|
|
39
|
+
/// </summary>
|
|
40
|
+
[Tooltip("")]
|
|
41
|
+
[SerializeField] protected StringWithEvent currentControlsKey = null;
|
|
42
|
+
|
|
43
|
+
/// <summary>
|
|
44
|
+
///
|
|
45
|
+
/// </summary>
|
|
46
|
+
[Tooltip("")]
|
|
47
|
+
[SerializeField] protected SceneEventListener onFinishedLoadingRoomNoDialogue = null;
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
/// <summary>
|
|
51
|
+
///
|
|
52
|
+
/// </summary>
|
|
53
|
+
[Header("")]
|
|
54
|
+
[Divider]
|
|
55
|
+
[Tooltip("")]
|
|
56
|
+
[SerializeField] protected bool setControlsKey = false;
|
|
57
|
+
|
|
58
|
+
/// <summary>
|
|
59
|
+
///
|
|
60
|
+
/// </summary>
|
|
61
|
+
[Tooltip("")]
|
|
62
|
+
[SerializeField] protected string controlsKey = "";
|
|
63
|
+
|
|
64
|
+
/// <summary>
|
|
65
|
+
///
|
|
66
|
+
/// </summary>
|
|
67
|
+
[Tooltip("")]
|
|
68
|
+
[SerializeField] protected bool endOfRoomLoad = false;
|
|
69
|
+
|
|
70
|
+
/// <summary>
|
|
71
|
+
///
|
|
72
|
+
/// </summary>
|
|
73
|
+
[Tooltip("")]
|
|
74
|
+
[SerializeField] protected bool useFadeOut = true;
|
|
75
|
+
|
|
76
|
+
/// <summary>
|
|
77
|
+
///
|
|
78
|
+
/// </summary>
|
|
79
|
+
[Tooltip("")]
|
|
80
|
+
[SerializeField] protected bool ignoreWaitTime = false;
|
|
81
|
+
|
|
82
|
+
/// <summary>
|
|
83
|
+
///
|
|
84
|
+
/// </summary>
|
|
85
|
+
[ShowIf(nameof(NotIgnoringWaitTime))]
|
|
86
|
+
[Tooltip("")]
|
|
87
|
+
[SerializeField] protected float baseWaitTime = 2;
|
|
88
|
+
|
|
89
|
+
/// <summary>
|
|
90
|
+
///
|
|
91
|
+
/// </summary>
|
|
92
|
+
[ShowIf(nameof(NotIgnoringWaitTime))]
|
|
93
|
+
[Tooltip("")]
|
|
94
|
+
[SerializeField] protected float postWaitTime = 1;
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
protected virtual void OnEnable()
|
|
98
|
+
{
|
|
99
|
+
DisableMenuObserve();
|
|
100
|
+
|
|
101
|
+
SubscribeStartUp();
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/// <summary>
|
|
105
|
+
///
|
|
106
|
+
/// </summary>
|
|
107
|
+
protected virtual void DisableMenuObserve()
|
|
108
|
+
{
|
|
109
|
+
hasMenuAccess.SetValue(false);
|
|
110
|
+
|
|
111
|
+
observeModeLocked.SetValue(true);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/// <summary>
|
|
115
|
+
///
|
|
116
|
+
/// </summary>
|
|
117
|
+
protected virtual void SubscribeStartUp()
|
|
118
|
+
{
|
|
119
|
+
if (endOfRoomLoad)
|
|
120
|
+
onFinishedLoadingRoomNoDialogue.Response.AddListener(StartUp);
|
|
121
|
+
else if (ServiceLocator.HasService(out IDialogueManager manager) &&
|
|
122
|
+
manager.GetFinisher() is IInstantDialogueFinisherSubscriber subscriber)
|
|
123
|
+
subscriber.SubscribeToOnFinishOfInstantDialogue(StartUp);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/// <summary>
|
|
127
|
+
///
|
|
128
|
+
/// </summary>
|
|
129
|
+
protected virtual void StartUp()
|
|
130
|
+
{
|
|
131
|
+
DisableMenuObserve();
|
|
132
|
+
|
|
133
|
+
StartCoroutine(FadeOutOnLoad());
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/// <summary>
|
|
137
|
+
///
|
|
138
|
+
/// </summary>
|
|
139
|
+
protected virtual IEnumerator FadeOutOnLoad()
|
|
140
|
+
{
|
|
141
|
+
onFTEMinigame.SetValue(true);
|
|
142
|
+
|
|
143
|
+
if (!ignoreWaitTime)
|
|
144
|
+
yield return new WaitForSeconds(baseWaitTime);
|
|
145
|
+
|
|
146
|
+
if (useFadeOut && ServiceLocator.GetService<GlobalFade>().IsDark)
|
|
147
|
+
ServiceLocator.GetService<GlobalFade>().FadeOut(postWaitTime);
|
|
148
|
+
|
|
149
|
+
if (!ignoreWaitTime)
|
|
150
|
+
yield return new WaitForSecondsRealtime(postWaitTime);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/// <summary>
|
|
154
|
+
///
|
|
155
|
+
/// </summary>
|
|
156
|
+
/// <returns></returns>
|
|
157
|
+
protected virtual bool NotIgnoringWaitTime() => !ignoreWaitTime;
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
protected virtual void OnDisable()
|
|
161
|
+
{
|
|
162
|
+
UnsubscribeStartUp();
|
|
163
|
+
|
|
164
|
+
EnableMenuObserve();
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/// <summary>
|
|
168
|
+
///
|
|
169
|
+
/// </summary>
|
|
170
|
+
protected virtual void UnsubscribeStartUp()
|
|
171
|
+
{
|
|
172
|
+
if (endOfRoomLoad)
|
|
173
|
+
onFinishedLoadingRoomNoDialogue.Response.RemoveListener(StartUp);
|
|
174
|
+
else if (ServiceLocator.HasService<IDialogueManager>(out var manager) &&
|
|
175
|
+
manager.GetFinisher() is IInstantDialogueFinisherSubscriber subscriber)
|
|
176
|
+
subscriber.UnsubscribeToOnFinishOfInstantDialogue(StartUp);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/// <summary>
|
|
180
|
+
///
|
|
181
|
+
/// </summary>
|
|
182
|
+
protected virtual void EnableMenuObserve()
|
|
183
|
+
{
|
|
184
|
+
onFTEMinigame.SetValue(false);
|
|
185
|
+
|
|
186
|
+
observeModeLocked.SetValue(false);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
protected virtual void Update()
|
|
191
|
+
{
|
|
192
|
+
hasMenuAccess.SetValue(false);
|
|
193
|
+
|
|
194
|
+
if (setControlsKey)
|
|
195
|
+
currentControlsKey.SetValue(controlsKey);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|