net.dreditor.chapterselection 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/ChapterSceneByLatestObjective.cs +188 -188
- package/ChapterSceneByLatestObjective.cs.meta +1 -1
- package/ChapterSceneHandler.cs +151 -151
- package/ChapterSceneHandler.cs.meta +11 -11
- package/ChapterSectionBase.cs +139 -139
- package/ChapterSectionBase.cs.meta +11 -11
- package/ChapterSelectCollection.cs +48 -48
- package/ChapterSelectCollection.cs.meta +1 -1
- package/ChapterSelectCollectionBase.cs +71 -71
- package/ChapterSelectCollectionBase.cs.meta +1 -1
- package/ChapterSelectData.cs +55 -55
- package/ChapterSelectData.cs.meta +11 -11
- package/ChapterSelectDatabase.cs +28 -28
- package/ChapterSelectDatabase.cs.meta +11 -11
- package/ChapterSelectFallbackEvaluator.cs +24 -24
- package/ChapterSelectFallbackEvaluator.cs.meta +1 -1
- package/ChapterSelectHandler.cs +60 -60
- package/ChapterSelectHandler.cs.meta +11 -11
- package/ChapterSelectHistoryManager.cs +15 -15
- package/ChapterSelectHistoryManager.cs.meta +1 -1
- package/ChapterSelectManager.cs +196 -196
- package/ChapterSelectManager.cs.meta +11 -11
- package/ChapterSelectSaveData.cs +53 -53
- package/ChapterSelectSaveData.cs.meta +1 -1
- package/ChapterSelectUIHandler.cs +136 -136
- package/ChapterSelectUIHandler.cs.meta +11 -11
- package/ChapterSubSectionBase.cs +77 -77
- package/ChapterSubSectionBase.cs.meta +1 -1
- package/DREditor.ChapterSelection.asmdef +19 -19
- package/DREditor.ChapterSelection.asmdef.meta +7 -7
- package/IChapterSelectData.cs +14 -14
- package/IChapterSelectData.cs.meta +1 -1
- package/{Samples → Samples~}/Animations/ChapSelect.controller +191 -191
- package/{Samples → Samples~}/Animations/ChapSelect.controller.meta +8 -8
- package/{Samples → Samples~}/Animations/HideChapterSelect.anim +232 -232
- package/{Samples → Samples~}/Animations/HideChapterSelect.anim.meta +8 -8
- package/{Samples → Samples~}/Animations.meta +8 -8
- package/{Samples → Samples~}/CS_Select_Button_DRE.prefab +305 -305
- package/{Samples → Samples~}/CS_Select_Button_DRE.prefab.meta +7 -7
- package/{Samples → Samples~}/Chapter_Scene_UI_Canvas_Shell.prefab +393 -393
- package/{Samples → Samples~}/Chapter_Scene_UI_Canvas_Shell.prefab.meta +7 -7
- package/{Samples → Samples~}/Chapter_Scene_UI_Canvas_Template.prefab +771 -771
- package/{Samples → Samples~}/Chapter_Scene_UI_Canvas_Template.prefab.meta +7 -7
- package/{Samples → Samples~}/Chapter_Select_Difficulty_UI_Canvas_Template.prefab +226 -226
- package/{Samples → Samples~}/Chapter_Select_Difficulty_UI_Canvas_Template.prefab.meta +7 -7
- package/{Samples → Samples~}/Chapter_Select_History_Manager.prefab +98 -98
- package/{Samples → Samples~}/Chapter_Select_History_Manager.prefab.meta +7 -7
- package/{Samples → Samples~}/Chapter_Select_System_Shell.prefab +61 -61
- package/{Samples → Samples~}/Chapter_Select_System_Shell.prefab.meta +7 -7
- package/{Samples → Samples~}/Chapter_Select_System_Template.prefab +549 -549
- package/{Samples → Samples~}/Chapter_Select_System_Template.prefab.meta +7 -7
- package/{Samples → Samples~}/Chapter_Select_UI_Canvas_Shell.prefab +543 -543
- package/{Samples → Samples~}/Chapter_Select_UI_Canvas_Shell.prefab.meta +7 -7
- package/{Samples → Samples~}/Chapter_Select_UI_Canvas_Template.prefab +1001 -1001
- package/{Samples → Samples~}/Chapter_Select_UI_Canvas_Template.prefab.meta +7 -7
- package/{Samples → Samples~}/StartChapterSelectGame.asset +15 -15
- package/{Samples → Samples~}/StartChapterSelectGame.asset.meta +8 -8
- package/SceneDataProvider.cs +25 -25
- package/SceneDataProvider.cs.meta +11 -11
- package/SceneDataProviderBase.cs +36 -36
- package/SceneDataProviderBase.cs.meta +11 -11
- package/UnlockChapterSelectScene.cs +48 -48
- package/UnlockChapterSelectScene.cs.meta +1 -1
- package/package.json +42 -37
- package/package.json.meta +7 -7
- package/Samples.meta +0 -8
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
-
using System.Collections;
|
|
3
|
-
using System.Collections.Generic;
|
|
4
|
-
using UnityEngine;
|
|
5
|
-
using UnityEngine.Serialization;
|
|
6
|
-
|
|
7
|
-
namespace DREditor.ChapterSelection
|
|
8
|
-
{
|
|
9
|
-
/// <summary>
|
|
10
|
-
///
|
|
11
|
-
/// </summary>
|
|
12
|
-
/// <typeparam name="T"></typeparam>
|
|
13
|
-
public abstract class ChapterSelectCollection<T> : ChapterSelectCollectionBase, IEnumerable<T>
|
|
14
|
-
{
|
|
15
|
-
/// <summary>
|
|
16
|
-
///
|
|
17
|
-
/// </summary>
|
|
18
|
-
[FormerlySerializedAs("ChapterScenes")]
|
|
19
|
-
[FormerlySerializedAs("ChapterDatas")]
|
|
20
|
-
[Tooltip("")]
|
|
21
|
-
[SerializeField] protected List<T> chapterSelectDetails = new();
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
/// <summary>
|
|
25
|
-
///
|
|
26
|
-
/// </summary>
|
|
27
|
-
public virtual List<T> Details => chapterSelectDetails;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
/// <summary>
|
|
31
|
-
///
|
|
32
|
-
/// </summary>
|
|
33
|
-
/// <param name="i"></param>
|
|
34
|
-
/// <returns></returns>
|
|
35
|
-
public virtual T this[int i] => chapterSelectDetails[i];
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
public override IList GetCollection() => Details;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
public virtual IEnumerator<T> GetEnumerator()
|
|
42
|
-
{
|
|
43
|
-
foreach (var detail in chapterSelectDetails)
|
|
44
|
-
yield return detail;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
|
|
48
|
-
}
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using System.Collections;
|
|
3
|
+
using System.Collections.Generic;
|
|
4
|
+
using UnityEngine;
|
|
5
|
+
using UnityEngine.Serialization;
|
|
6
|
+
|
|
7
|
+
namespace DREditor.ChapterSelection
|
|
8
|
+
{
|
|
9
|
+
/// <summary>
|
|
10
|
+
///
|
|
11
|
+
/// </summary>
|
|
12
|
+
/// <typeparam name="T"></typeparam>
|
|
13
|
+
public abstract class ChapterSelectCollection<T> : ChapterSelectCollectionBase, IEnumerable<T>
|
|
14
|
+
{
|
|
15
|
+
/// <summary>
|
|
16
|
+
///
|
|
17
|
+
/// </summary>
|
|
18
|
+
[FormerlySerializedAs("ChapterScenes")]
|
|
19
|
+
[FormerlySerializedAs("ChapterDatas")]
|
|
20
|
+
[Tooltip("")]
|
|
21
|
+
[SerializeField] protected List<T> chapterSelectDetails = new();
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
/// <summary>
|
|
25
|
+
///
|
|
26
|
+
/// </summary>
|
|
27
|
+
public virtual List<T> Details => chapterSelectDetails;
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
/// <summary>
|
|
31
|
+
///
|
|
32
|
+
/// </summary>
|
|
33
|
+
/// <param name="i"></param>
|
|
34
|
+
/// <returns></returns>
|
|
35
|
+
public virtual T this[int i] => chapterSelectDetails[i];
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
public override IList GetCollection() => Details;
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
public virtual IEnumerator<T> GetEnumerator()
|
|
42
|
+
{
|
|
43
|
+
foreach (var detail in chapterSelectDetails)
|
|
44
|
+
yield return detail;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
|
|
48
|
+
}
|
|
49
49
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
1
|
+
fileFormatVersion: 2
|
|
2
2
|
guid: 5f724ca25b6a1e64d82a799bccf1eeaf
|
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
-
using System.Collections;
|
|
3
|
-
using System.Collections.Generic;
|
|
4
|
-
using UnityEngine;
|
|
5
|
-
|
|
6
|
-
namespace DREditor.ChapterSelection
|
|
7
|
-
{
|
|
8
|
-
/// <summary>
|
|
9
|
-
///
|
|
10
|
-
/// </summary>
|
|
11
|
-
public abstract class ChapterSelectCollectionBase : ScriptableObject
|
|
12
|
-
{
|
|
13
|
-
/// <summary>
|
|
14
|
-
///
|
|
15
|
-
/// </summary>
|
|
16
|
-
/// <typeparam name="T"></typeparam>
|
|
17
|
-
/// <param name="collection"></param>
|
|
18
|
-
/// <returns></returns>
|
|
19
|
-
public virtual bool TryGetCollection<T>(out List<T> collection)
|
|
20
|
-
{
|
|
21
|
-
collection = GetCollection() is List<T> castedCollection ? castedCollection : null;
|
|
22
|
-
|
|
23
|
-
bool result = collection != null;
|
|
24
|
-
|
|
25
|
-
if (!result)
|
|
26
|
-
Debug.LogWarning($"ALERT: {name}'s collection is not of type: {typeof(T).Name}!");
|
|
27
|
-
|
|
28
|
-
return result;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/// <summary>
|
|
32
|
-
///
|
|
33
|
-
/// </summary>
|
|
34
|
-
/// <returns></returns>
|
|
35
|
-
public abstract IList GetCollection();
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
/// <summary>
|
|
39
|
-
///
|
|
40
|
-
/// </summary>
|
|
41
|
-
/// <returns></returns>
|
|
42
|
-
public virtual bool IsEmpty() => CollectionCountEmpty() || ChildrenAreEmpty();
|
|
43
|
-
|
|
44
|
-
/// <summary>
|
|
45
|
-
///
|
|
46
|
-
/// </summary>
|
|
47
|
-
/// <returns></returns>
|
|
48
|
-
protected virtual bool ChildrenAreEmpty()
|
|
49
|
-
{
|
|
50
|
-
IList collection = GetCollection();
|
|
51
|
-
|
|
52
|
-
foreach (var item in collection)
|
|
53
|
-
if (item is ChapterSelectCollectionBase childCollection && childCollection.IsEmpty())
|
|
54
|
-
return true;
|
|
55
|
-
|
|
56
|
-
return false;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/// <summary>
|
|
60
|
-
///
|
|
61
|
-
/// </summary>
|
|
62
|
-
/// <returns></returns>
|
|
63
|
-
private bool CollectionCountEmpty() => GetDataCount() == 0;
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
/// <summary>
|
|
67
|
-
///
|
|
68
|
-
/// </summary>
|
|
69
|
-
/// <returns></returns>
|
|
70
|
-
public virtual int GetDataCount() => GetCollection().Count;
|
|
71
|
-
}
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using System.Collections;
|
|
3
|
+
using System.Collections.Generic;
|
|
4
|
+
using UnityEngine;
|
|
5
|
+
|
|
6
|
+
namespace DREditor.ChapterSelection
|
|
7
|
+
{
|
|
8
|
+
/// <summary>
|
|
9
|
+
///
|
|
10
|
+
/// </summary>
|
|
11
|
+
public abstract class ChapterSelectCollectionBase : ScriptableObject
|
|
12
|
+
{
|
|
13
|
+
/// <summary>
|
|
14
|
+
///
|
|
15
|
+
/// </summary>
|
|
16
|
+
/// <typeparam name="T"></typeparam>
|
|
17
|
+
/// <param name="collection"></param>
|
|
18
|
+
/// <returns></returns>
|
|
19
|
+
public virtual bool TryGetCollection<T>(out List<T> collection)
|
|
20
|
+
{
|
|
21
|
+
collection = GetCollection() is List<T> castedCollection ? castedCollection : null;
|
|
22
|
+
|
|
23
|
+
bool result = collection != null;
|
|
24
|
+
|
|
25
|
+
if (!result)
|
|
26
|
+
Debug.LogWarning($"ALERT: {name}'s collection is not of type: {typeof(T).Name}!");
|
|
27
|
+
|
|
28
|
+
return result;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/// <summary>
|
|
32
|
+
///
|
|
33
|
+
/// </summary>
|
|
34
|
+
/// <returns></returns>
|
|
35
|
+
public abstract IList GetCollection();
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
/// <summary>
|
|
39
|
+
///
|
|
40
|
+
/// </summary>
|
|
41
|
+
/// <returns></returns>
|
|
42
|
+
public virtual bool IsEmpty() => CollectionCountEmpty() || ChildrenAreEmpty();
|
|
43
|
+
|
|
44
|
+
/// <summary>
|
|
45
|
+
///
|
|
46
|
+
/// </summary>
|
|
47
|
+
/// <returns></returns>
|
|
48
|
+
protected virtual bool ChildrenAreEmpty()
|
|
49
|
+
{
|
|
50
|
+
IList collection = GetCollection();
|
|
51
|
+
|
|
52
|
+
foreach (var item in collection)
|
|
53
|
+
if (item is ChapterSelectCollectionBase childCollection && childCollection.IsEmpty())
|
|
54
|
+
return true;
|
|
55
|
+
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/// <summary>
|
|
60
|
+
///
|
|
61
|
+
/// </summary>
|
|
62
|
+
/// <returns></returns>
|
|
63
|
+
private bool CollectionCountEmpty() => GetDataCount() == 0;
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
/// <summary>
|
|
67
|
+
///
|
|
68
|
+
/// </summary>
|
|
69
|
+
/// <returns></returns>
|
|
70
|
+
public virtual int GetDataCount() => GetCollection().Count;
|
|
71
|
+
}
|
|
72
72
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
1
|
+
fileFormatVersion: 2
|
|
2
2
|
guid: 509cf55ecda99624e808590ba1447dab
|
package/ChapterSelectData.cs
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
-
using System;
|
|
3
|
-
using System.Collections.Generic;
|
|
4
|
-
using UnityEngine;
|
|
5
|
-
|
|
6
|
-
namespace DREditor.ChapterSelection
|
|
7
|
-
{
|
|
8
|
-
/// <summary>
|
|
9
|
-
///
|
|
10
|
-
/// </summary>
|
|
11
|
-
[Serializable]
|
|
12
|
-
[CreateAssetMenu(menuName = "DREditor/Chapter Select/Data", fileName = "Chapter Select Data")]
|
|
13
|
-
public class ChapterSelectData : ChapterSelectCollection<SceneDataProviderBase>
|
|
14
|
-
{
|
|
15
|
-
/// <summary>
|
|
16
|
-
///
|
|
17
|
-
/// </summary>
|
|
18
|
-
[Header("")]
|
|
19
|
-
[Divider]
|
|
20
|
-
[Tooltip("")]
|
|
21
|
-
public int chapter;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
/// <summary>
|
|
25
|
-
///
|
|
26
|
-
/// </summary>
|
|
27
|
-
/// <param name="queue"></param>
|
|
28
|
-
/// <returns></returns>
|
|
29
|
-
public virtual object GetChapterSelectData(Queue<int> queue)
|
|
30
|
-
{
|
|
31
|
-
int selectedScene = queue.Dequeue();
|
|
32
|
-
|
|
33
|
-
int useIndex = GetIndexOfSelectScene(selectedScene);
|
|
34
|
-
|
|
35
|
-
var data = chapterSelectDetails[useIndex];
|
|
36
|
-
|
|
37
|
-
return data;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/// <summary>
|
|
41
|
-
///
|
|
42
|
-
/// </summary>
|
|
43
|
-
/// <returns></returns>
|
|
44
|
-
protected virtual int GetIndexOfSelectScene(int selectedEnd)
|
|
45
|
-
{
|
|
46
|
-
foreach (var sceneData in chapterSelectDetails)
|
|
47
|
-
if (sceneData.selectScene == selectedEnd)
|
|
48
|
-
return chapterSelectDetails.IndexOf(sceneData);
|
|
49
|
-
|
|
50
|
-
UnityEngine.Debug.LogWarning("Chapter Select: ALERT: " +
|
|
51
|
-
"Using default end because it couldn't find a matching select scene!");
|
|
52
|
-
|
|
53
|
-
return selectedEnd;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using System;
|
|
3
|
+
using System.Collections.Generic;
|
|
4
|
+
using UnityEngine;
|
|
5
|
+
|
|
6
|
+
namespace DREditor.ChapterSelection
|
|
7
|
+
{
|
|
8
|
+
/// <summary>
|
|
9
|
+
///
|
|
10
|
+
/// </summary>
|
|
11
|
+
[Serializable]
|
|
12
|
+
[CreateAssetMenu(menuName = "DREditor/Chapter Select/Data", fileName = "Chapter Select Data")]
|
|
13
|
+
public class ChapterSelectData : ChapterSelectCollection<SceneDataProviderBase>
|
|
14
|
+
{
|
|
15
|
+
/// <summary>
|
|
16
|
+
///
|
|
17
|
+
/// </summary>
|
|
18
|
+
[Header("")]
|
|
19
|
+
[Divider]
|
|
20
|
+
[Tooltip("")]
|
|
21
|
+
public int chapter;
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
/// <summary>
|
|
25
|
+
///
|
|
26
|
+
/// </summary>
|
|
27
|
+
/// <param name="queue"></param>
|
|
28
|
+
/// <returns></returns>
|
|
29
|
+
public virtual object GetChapterSelectData(Queue<int> queue)
|
|
30
|
+
{
|
|
31
|
+
int selectedScene = queue.Dequeue();
|
|
32
|
+
|
|
33
|
+
int useIndex = GetIndexOfSelectScene(selectedScene);
|
|
34
|
+
|
|
35
|
+
var data = chapterSelectDetails[useIndex];
|
|
36
|
+
|
|
37
|
+
return data;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/// <summary>
|
|
41
|
+
///
|
|
42
|
+
/// </summary>
|
|
43
|
+
/// <returns></returns>
|
|
44
|
+
protected virtual int GetIndexOfSelectScene(int selectedEnd)
|
|
45
|
+
{
|
|
46
|
+
foreach (var sceneData in chapterSelectDetails)
|
|
47
|
+
if (sceneData.selectScene == selectedEnd)
|
|
48
|
+
return chapterSelectDetails.IndexOf(sceneData);
|
|
49
|
+
|
|
50
|
+
UnityEngine.Debug.LogWarning("Chapter Select: ALERT: " +
|
|
51
|
+
"Using default end because it couldn't find a matching select scene!");
|
|
52
|
+
|
|
53
|
+
return selectedEnd;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
56
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: d22c19dc12cab4f47a81b9d9aecd90d1
|
|
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: d22c19dc12cab4f47a81b9d9aecd90d1
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences: []
|
|
7
|
+
executionOrder: 0
|
|
8
|
+
icon: {instanceID: 0}
|
|
9
|
+
userData:
|
|
10
|
+
assetBundleName:
|
|
11
|
+
assetBundleVariant:
|
package/ChapterSelectDatabase.cs
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
-
using System;
|
|
3
|
-
using System.Collections.Generic;
|
|
4
|
-
using UnityEngine;
|
|
5
|
-
|
|
6
|
-
namespace DREditor.ChapterSelection
|
|
7
|
-
{
|
|
8
|
-
/// <summary>
|
|
9
|
-
///
|
|
10
|
-
/// </summary>
|
|
11
|
-
[Serializable]
|
|
12
|
-
[CreateAssetMenu(menuName = "DREditor/Chapter Select/Database", fileName = "Chapter Select Database")]
|
|
13
|
-
public class ChapterSelectDatabase : ChapterSelectCollection<ChapterSelectData>
|
|
14
|
-
{
|
|
15
|
-
/// <summary>
|
|
16
|
-
///
|
|
17
|
-
/// </summary>
|
|
18
|
-
/// <param name="queue"></param>
|
|
19
|
-
/// <returns></returns>
|
|
20
|
-
public virtual object GetChapterSelectData(Queue<int> queue)
|
|
21
|
-
{
|
|
22
|
-
int selectedChapter = queue.Dequeue();
|
|
23
|
-
|
|
24
|
-
var data = chapterSelectDetails[selectedChapter].GetChapterSelectData(queue);
|
|
25
|
-
|
|
26
|
-
return data;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using System;
|
|
3
|
+
using System.Collections.Generic;
|
|
4
|
+
using UnityEngine;
|
|
5
|
+
|
|
6
|
+
namespace DREditor.ChapterSelection
|
|
7
|
+
{
|
|
8
|
+
/// <summary>
|
|
9
|
+
///
|
|
10
|
+
/// </summary>
|
|
11
|
+
[Serializable]
|
|
12
|
+
[CreateAssetMenu(menuName = "DREditor/Chapter Select/Database", fileName = "Chapter Select Database")]
|
|
13
|
+
public class ChapterSelectDatabase : ChapterSelectCollection<ChapterSelectData>
|
|
14
|
+
{
|
|
15
|
+
/// <summary>
|
|
16
|
+
///
|
|
17
|
+
/// </summary>
|
|
18
|
+
/// <param name="queue"></param>
|
|
19
|
+
/// <returns></returns>
|
|
20
|
+
public virtual object GetChapterSelectData(Queue<int> queue)
|
|
21
|
+
{
|
|
22
|
+
int selectedChapter = queue.Dequeue();
|
|
23
|
+
|
|
24
|
+
var data = chapterSelectDetails[selectedChapter].GetChapterSelectData(queue);
|
|
25
|
+
|
|
26
|
+
return data;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
29
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: bcf1bac9a9d150141a81447013be69ed
|
|
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: bcf1bac9a9d150141a81447013be69ed
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences: []
|
|
7
|
+
executionOrder: 0
|
|
8
|
+
icon: {instanceID: 0}
|
|
9
|
+
userData:
|
|
10
|
+
assetBundleName:
|
|
11
|
+
assetBundleVariant:
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
-
using UnityEngine;
|
|
3
|
-
|
|
4
|
-
namespace DREditor.ChapterSelection
|
|
5
|
-
{
|
|
6
|
-
/// <summary>
|
|
7
|
-
///
|
|
8
|
-
/// </summary>
|
|
9
|
-
public abstract class ChapterSelectFallbackEvaluator : MonoBehaviour
|
|
10
|
-
{
|
|
11
|
-
/// <summary>
|
|
12
|
-
///
|
|
13
|
-
/// </summary>
|
|
14
|
-
/// <returns></returns>
|
|
15
|
-
public abstract int GetMaxScene(ChapterSectionBase parentSection);
|
|
16
|
-
|
|
17
|
-
/// <summary>
|
|
18
|
-
///
|
|
19
|
-
/// </summary>
|
|
20
|
-
/// <param name="sceneData"></param>
|
|
21
|
-
/// <param name="parentSection"></param>
|
|
22
|
-
/// <returns></returns>
|
|
23
|
-
public abstract bool SceneIsValid(SceneDataProviderBase sceneData, ChapterSectionBase parentSection);
|
|
24
|
-
}
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using UnityEngine;
|
|
3
|
+
|
|
4
|
+
namespace DREditor.ChapterSelection
|
|
5
|
+
{
|
|
6
|
+
/// <summary>
|
|
7
|
+
///
|
|
8
|
+
/// </summary>
|
|
9
|
+
public abstract class ChapterSelectFallbackEvaluator : MonoBehaviour
|
|
10
|
+
{
|
|
11
|
+
/// <summary>
|
|
12
|
+
///
|
|
13
|
+
/// </summary>
|
|
14
|
+
/// <returns></returns>
|
|
15
|
+
public abstract int GetMaxScene(ChapterSectionBase parentSection);
|
|
16
|
+
|
|
17
|
+
/// <summary>
|
|
18
|
+
///
|
|
19
|
+
/// </summary>
|
|
20
|
+
/// <param name="sceneData"></param>
|
|
21
|
+
/// <param name="parentSection"></param>
|
|
22
|
+
/// <returns></returns>
|
|
23
|
+
public abstract bool SceneIsValid(SceneDataProviderBase sceneData, ChapterSectionBase parentSection);
|
|
24
|
+
}
|
|
25
25
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
1
|
+
fileFormatVersion: 2
|
|
2
2
|
guid: c8b2f118336b116488561dc5f0c059f2
|
package/ChapterSelectHandler.cs
CHANGED
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
-
using DREditor.Processables;
|
|
3
|
-
using DREditor.Saving;
|
|
4
|
-
using DREditor.Services;
|
|
5
|
-
|
|
6
|
-
namespace DREditor.ChapterSelection
|
|
7
|
-
{
|
|
8
|
-
/// <summary>
|
|
9
|
-
///
|
|
10
|
-
/// </summary>
|
|
11
|
-
[ClassHeader(nameof(ChapterSectionBase) + ", " + nameof(IDRELoadableManager) +
|
|
12
|
-
"\n\n")]
|
|
13
|
-
public class ChapterSelectHandler : ChapterSectionBase
|
|
14
|
-
{
|
|
15
|
-
/// <inheritdoc/>
|
|
16
|
-
public override void OnParentSubmittedIndex(int selectedIndex) => selectedSection = selectedIndex;
|
|
17
|
-
|
|
18
|
-
/// <inheritdoc/>
|
|
19
|
-
public override void InitializeDefault()
|
|
20
|
-
{
|
|
21
|
-
SetMaxSection(defaultUnlockedSections);
|
|
22
|
-
|
|
23
|
-
ActivateValidChapterButtons();
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/// <inheritdoc/>
|
|
27
|
-
public override void InitializeLoaded()
|
|
28
|
-
{
|
|
29
|
-
SetMaxSection(GetMaxLoadedScene());
|
|
30
|
-
|
|
31
|
-
ActivateValidChapterButtons();
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/// <summary>
|
|
35
|
-
///
|
|
36
|
-
/// </summary>
|
|
37
|
-
/// <returns></returns>
|
|
38
|
-
protected int GetMaxLoadedScene()
|
|
39
|
-
{
|
|
40
|
-
ServiceLocator.HasService(out IChapterSelectData chapterSelectData);
|
|
41
|
-
|
|
42
|
-
int maxLoadedIndex = -1;
|
|
43
|
-
|
|
44
|
-
foreach (var section in chapterSelectDatabase)
|
|
45
|
-
foreach (var scene in section)
|
|
46
|
-
if (chapterSelectData is IIdentifiableValidator validator && validator.IDValid(scene.ID))
|
|
47
|
-
maxLoadedIndex = chapterSelectDatabase.Details.IndexOf(section);
|
|
48
|
-
|
|
49
|
-
return maxLoadedIndex != -1? maxLoadedIndex : loadedChapter;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/// <summary>
|
|
53
|
-
///
|
|
54
|
-
/// </summary>
|
|
55
|
-
protected virtual void ActivateValidChapterButtons()
|
|
56
|
-
{
|
|
57
|
-
for (int i = 0; i < sectionButtons.Count; i++)
|
|
58
|
-
sectionButtons[i].gameObject.SetActive(i <= maxSection);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using DREditor.Processables;
|
|
3
|
+
using DREditor.Saving;
|
|
4
|
+
using DREditor.Services;
|
|
5
|
+
|
|
6
|
+
namespace DREditor.ChapterSelection
|
|
7
|
+
{
|
|
8
|
+
/// <summary>
|
|
9
|
+
///
|
|
10
|
+
/// </summary>
|
|
11
|
+
[ClassHeader(nameof(ChapterSectionBase) + ", " + nameof(IDRELoadableManager) +
|
|
12
|
+
"\n\n")]
|
|
13
|
+
public class ChapterSelectHandler : ChapterSectionBase
|
|
14
|
+
{
|
|
15
|
+
/// <inheritdoc/>
|
|
16
|
+
public override void OnParentSubmittedIndex(int selectedIndex) => selectedSection = selectedIndex;
|
|
17
|
+
|
|
18
|
+
/// <inheritdoc/>
|
|
19
|
+
public override void InitializeDefault()
|
|
20
|
+
{
|
|
21
|
+
SetMaxSection(defaultUnlockedSections);
|
|
22
|
+
|
|
23
|
+
ActivateValidChapterButtons();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/// <inheritdoc/>
|
|
27
|
+
public override void InitializeLoaded()
|
|
28
|
+
{
|
|
29
|
+
SetMaxSection(GetMaxLoadedScene());
|
|
30
|
+
|
|
31
|
+
ActivateValidChapterButtons();
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/// <summary>
|
|
35
|
+
///
|
|
36
|
+
/// </summary>
|
|
37
|
+
/// <returns></returns>
|
|
38
|
+
protected int GetMaxLoadedScene()
|
|
39
|
+
{
|
|
40
|
+
ServiceLocator.HasService(out IChapterSelectData chapterSelectData);
|
|
41
|
+
|
|
42
|
+
int maxLoadedIndex = -1;
|
|
43
|
+
|
|
44
|
+
foreach (var section in chapterSelectDatabase)
|
|
45
|
+
foreach (var scene in section)
|
|
46
|
+
if (chapterSelectData is IIdentifiableValidator validator && validator.IDValid(scene.ID))
|
|
47
|
+
maxLoadedIndex = chapterSelectDatabase.Details.IndexOf(section);
|
|
48
|
+
|
|
49
|
+
return maxLoadedIndex != -1? maxLoadedIndex : loadedChapter;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/// <summary>
|
|
53
|
+
///
|
|
54
|
+
/// </summary>
|
|
55
|
+
protected virtual void ActivateValidChapterButtons()
|
|
56
|
+
{
|
|
57
|
+
for (int i = 0; i < sectionButtons.Count; i++)
|
|
58
|
+
sectionButtons[i].gameObject.SetActive(i <= maxSection);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
61
|
}
|