net.dreditor.freetimesurfacing 0.1.6 → 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 +26 -26
- package/DREditor.FreeTimeSurfacing.asmdef.meta +7 -7
- package/FTEGameSceneSurface.cs +47 -47
- package/FTEGameSceneSurface.cs.meta +11 -11
- package/FTEPurchaseCompleteHandler.cs +63 -63
- package/FTEPurchaseCompleteHandler.cs.meta +11 -11
- package/FTESurfaceComponent.cs +9 -9
- package/FTESurfaceComponent.cs.meta +1 -1
- package/FTESurfaceManager.cs +48 -48
- package/FTESurfaceManager.cs.meta +1 -1
- package/FTESurfaceSelectionListener.cs +44 -44
- package/FTESurfaceSelectionListener.cs.meta +1 -1
- package/FTESurfaceUpdatableVisibility.cs +63 -63
- package/FTESurfaceUpdatableVisibility.cs.meta +1 -1
- package/IFTESurfaceManager.cs +29 -29
- package/IFTESurfaceManager.cs.meta +1 -1
- package/InitializeFTESurfacingInput.cs +37 -37
- package/InitializeFTESurfacingInput.cs.meta +1 -1
- package/InitializeLoadingFTESurfacing.cs +197 -197
- package/InitializeLoadingFTESurfacing.cs.meta +11 -11
- package/LeaveFTESurfacing.cs +161 -161
- package/LeaveFTESurfacing.cs.meta +1 -1
- package/{Samples → Samples~}/DRE_FTEMinigames.unity +649 -649
- package/{Samples → Samples~}/DRE_FTEMinigames.unity.meta +7 -7
- package/{Samples → Samples~}/FTESurfaceInputAllowed.asset +21 -21
- package/{Samples → Samples~}/FTESurfaceInputAllowed.asset.meta +8 -8
- package/{Samples → Samples~}/FTE_Buffered_Selected_UI_Cacher.prefab +137 -137
- package/{Samples → Samples~}/FTE_Buffered_Selected_UI_Cacher.prefab.meta +7 -7
- package/{Samples → Samples~}/FTE_Controls_Callable_UI.prefab +51 -51
- package/{Samples → Samples~}/FTE_Controls_Callable_UI.prefab.meta +7 -7
- package/{Samples → Samples~}/FTE_Minigame_Surface_ETemplate.prefab +48 -48
- package/{Samples → Samples~}/FTE_Minigame_Surface_ETemplate.prefab.meta +7 -7
- package/{Samples → Samples~}/FTE_Surface_Canvas_Shell.prefab +253 -253
- package/{Samples → Samples~}/FTE_Surface_Canvas_Shell.prefab.meta +7 -7
- package/{Samples → Samples~}/FTE_Surface_Canvas_Template.prefab +333 -333
- package/{Samples → Samples~}/FTE_Surface_Canvas_Template.prefab.meta +7 -7
- package/{Samples → Samples~}/FTE_Surface_Manager_Shell.prefab +52 -52
- package/{Samples → Samples~}/FTE_Surface_Manager_Shell.prefab.meta +7 -7
- package/{Samples → Samples~}/FTE_Surface_Manager_Template.prefab +411 -411
- package/{Samples → Samples~}/FTE_Surface_Manager_Template.prefab.meta +7 -7
- package/{Samples → Samples~}/FTE_Surface_System_Shell.prefab +602 -602
- package/{Samples → Samples~}/FTE_Surface_System_Shell.prefab.meta +7 -7
- package/{Samples → Samples~}/FTE_Surface_System_Template.prefab +360 -360
- package/{Samples → Samples~}/FTE_Surface_System_Template.prefab.meta +7 -7
- package/{Samples → Samples~}/FTE_Tutorial_Callable_UI.prefab +51 -51
- package/{Samples → Samples~}/FTE_Tutorial_Callable_UI.prefab.meta +7 -7
- package/{Samples → Samples~}/Initialize_Loading_FTE_Surfacing.prefab +145 -145
- package/{Samples → Samples~}/Initialize_Loading_FTE_Surfacing.prefab.meta +7 -7
- package/{Samples → Samples~}/Layered_Focused_Carousel_Shell.prefab +169 -169
- package/{Samples → Samples~}/Layered_Focused_Carousel_Shell.prefab.meta +7 -7
- package/{Samples → Samples~}/Layered_Focused_Carousel_Template.prefab +856 -856
- package/{Samples → Samples~}/Layered_Focused_Carousel_Template.prefab.meta +7 -7
- package/{Samples → Samples~}/OnCantPurchase.asset +15 -15
- package/{Samples → Samples~}/OnCantPurchase.asset.meta +8 -8
- package/{Samples → Samples~}/OnPurchase.asset +15 -15
- package/{Samples → Samples~}/OnPurchase.asset.meta +8 -8
- package/{Samples → Samples~}/OnPurchaseCompleted.asset +15 -15
- package/{Samples → Samples~}/OnPurchaseCompleted.asset.meta +8 -8
- package/{Samples → Samples~}/PaidAmount.asset +21 -21
- package/{Samples → Samples~}/PaidAmount.asset.meta +8 -8
- package/{Samples → Samples~}/Shift_On_Updated_FTE_Surfaces.prefab +46 -46
- package/{Samples → Samples~}/Shift_On_Updated_FTE_Surfaces.prefab.meta +7 -7
- package/ShiftOnUpdatedFTESurfaces.cs +22 -22
- package/ShiftOnUpdatedFTESurfaces.cs.meta +1 -1
- package/SubmittableFTESurfaceCollection.cs +109 -109
- package/SubmittableFTESurfaceCollection.cs.meta +1 -1
- package/SubmittableFTESurfaceComponent.cs +35 -35
- package/SubmittableFTESurfaceComponent.cs.meta +1 -1
- package/package.json +50 -45
- package/package.json.meta +7 -7
- package/Samples.meta +0 -8
package/.attestation.p7m
ADDED
|
Binary file
|
|
@@ -1,27 +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
|
|
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
27
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: 0dd8e0bf818fa6947be7ed02f44985dd
|
|
3
|
-
AssemblyDefinitionImporter:
|
|
4
|
-
externalObjects: {}
|
|
5
|
-
userData:
|
|
6
|
-
assetBundleName:
|
|
7
|
-
assetBundleVariant:
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: 0dd8e0bf818fa6947be7ed02f44985dd
|
|
3
|
+
AssemblyDefinitionImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
userData:
|
|
6
|
+
assetBundleName:
|
|
7
|
+
assetBundleVariant:
|
package/FTEGameSceneSurface.cs
CHANGED
|
@@ -1,48 +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
|
-
}
|
|
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
48
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: 963ee45e6a5b3af45a8befb18a35d74d
|
|
3
|
-
MonoImporter:
|
|
4
|
-
externalObjects: {}
|
|
5
|
-
serializedVersion: 2
|
|
6
|
-
defaultReferences: []
|
|
7
|
-
executionOrder: 0
|
|
8
|
-
icon: {instanceID: 0}
|
|
9
|
-
userData:
|
|
10
|
-
assetBundleName:
|
|
11
|
-
assetBundleVariant:
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: 963ee45e6a5b3af45a8befb18a35d74d
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences: []
|
|
7
|
+
executionOrder: 0
|
|
8
|
+
icon: {instanceID: 0}
|
|
9
|
+
userData:
|
|
10
|
+
assetBundleName:
|
|
11
|
+
assetBundleVariant:
|
|
@@ -1,64 +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
|
-
}
|
|
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
64
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: 2edc0ad31b7db224093037ca3e1d65c4
|
|
3
|
-
MonoImporter:
|
|
4
|
-
externalObjects: {}
|
|
5
|
-
serializedVersion: 2
|
|
6
|
-
defaultReferences: []
|
|
7
|
-
executionOrder: 0
|
|
8
|
-
icon: {instanceID: 0}
|
|
9
|
-
userData:
|
|
10
|
-
assetBundleName:
|
|
11
|
-
assetBundleVariant:
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: 2edc0ad31b7db224093037ca3e1d65c4
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences: []
|
|
7
|
+
executionOrder: 0
|
|
8
|
+
icon: {instanceID: 0}
|
|
9
|
+
userData:
|
|
10
|
+
assetBundleName:
|
|
11
|
+
assetBundleVariant:
|
package/FTESurfaceComponent.cs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
-
using UnityEngine;
|
|
3
|
-
|
|
4
|
-
namespace DREditor.FreeTimeSurfacing
|
|
5
|
-
{
|
|
6
|
-
/// <summary>
|
|
7
|
-
///
|
|
8
|
-
/// </summary>
|
|
9
|
-
public abstract class FTESurfaceComponent : MonoBehaviour { }
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using UnityEngine;
|
|
3
|
+
|
|
4
|
+
namespace DREditor.FreeTimeSurfacing
|
|
5
|
+
{
|
|
6
|
+
/// <summary>
|
|
7
|
+
///
|
|
8
|
+
/// </summary>
|
|
9
|
+
public abstract class FTESurfaceComponent : MonoBehaviour { }
|
|
10
10
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
1
|
+
fileFormatVersion: 2
|
|
2
2
|
guid: d624161a14ddcc746b5f6446c0832f5e
|
package/FTESurfaceManager.cs
CHANGED
|
@@ -1,49 +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
|
-
}
|
|
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
49
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
1
|
+
fileFormatVersion: 2
|
|
2
2
|
guid: 53c831846366f4a41abc8dd3bcc7ae96
|
|
@@ -1,45 +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
|
-
}
|
|
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
45
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
1
|
+
fileFormatVersion: 2
|
|
2
2
|
guid: e34e367b7f496c649ab464b3ac55ab3f
|