Skip to content

Commit 8ba3b43

Browse files
Merge branch 'release/2.0.1' into develop
2 parents 8390cf9 + f46be6f commit 8ba3b43

13 files changed

+176
-107
lines changed

Package/GameManager/Runtime/Demo/GameManagerSample.unity

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ MonoBehaviour:
258258
m_OnCullStateChanged:
259259
m_PersistentCalls:
260260
m_Calls: []
261-
m_text: Win(S)
261+
m_text: Win(W)
262262
m_isRightToLeft: 0
263263
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
264264
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
@@ -285,12 +285,12 @@ MonoBehaviour:
285285
m_faceColor:
286286
serializedVersion: 2
287287
rgba: 4294967295
288-
m_fontSize: 65.12
288+
m_fontSize: 50
289289
m_fontSizeBase: 24
290290
m_fontWeight: 400
291291
m_enableAutoSizing: 1
292-
m_fontSizeMin: 2.24
293-
m_fontSizeMax: 65.12
292+
m_fontSizeMin: 2.3
293+
m_fontSizeMax: 50
294294
m_fontStyle: 0
295295
m_HorizontalAlignment: 2
296296
m_VerticalAlignment: 512
@@ -503,7 +503,7 @@ MonoBehaviour:
503503
m_BlockingObjects: 0
504504
m_BlockingMask:
505505
serializedVersion: 2
506-
m_Bits: 4294967295
506+
m_Bits: 55
507507
--- !u!114 &520460759
508508
MonoBehaviour:
509509
m_ObjectHideFlags: 0
@@ -1160,12 +1160,12 @@ MonoBehaviour:
11601160
m_faceColor:
11611161
serializedVersion: 2
11621162
rgba: 4294967295
1163-
m_fontSize: 62.5
1163+
m_fontSize: 50
11641164
m_fontSizeBase: 24
11651165
m_fontWeight: 400
11661166
m_enableAutoSizing: 1
1167-
m_fontSizeMin: 2.24
1168-
m_fontSizeMax: 65.12
1167+
m_fontSizeMin: 2.3
1168+
m_fontSizeMax: 50
11691169
m_fontStyle: 0
11701170
m_HorizontalAlignment: 2
11711171
m_VerticalAlignment: 512
@@ -1510,12 +1510,12 @@ MonoBehaviour:
15101510
m_faceColor:
15111511
serializedVersion: 2
15121512
rgba: 4294967295
1513-
m_fontSize: 57.3
1513+
m_fontSize: 50
15141514
m_fontSizeBase: 24
15151515
m_fontWeight: 400
15161516
m_enableAutoSizing: 1
1517-
m_fontSizeMin: 2.24
1518-
m_fontSizeMax: 65.12
1517+
m_fontSizeMin: 2.3
1518+
m_fontSizeMax: 50
15191519
m_fontStyle: 0
15201520
m_HorizontalAlignment: 2
15211521
m_VerticalAlignment: 512
@@ -1644,12 +1644,12 @@ MonoBehaviour:
16441644
m_faceColor:
16451645
serializedVersion: 2
16461646
rgba: 4294967295
1647-
m_fontSize: 60.9
1647+
m_fontSize: 50
16481648
m_fontSizeBase: 24
16491649
m_fontWeight: 400
16501650
m_enableAutoSizing: 1
1651-
m_fontSizeMin: 2.24
1652-
m_fontSizeMax: 65.12
1651+
m_fontSizeMin: 2.3
1652+
m_fontSizeMax: 50
16531653
m_fontStyle: 0
16541654
m_HorizontalAlignment: 2
16551655
m_VerticalAlignment: 512
@@ -1904,6 +1904,10 @@ PrefabInstance:
19041904
propertyPath: Environment
19051905
value:
19061906
objectReference: {fileID: 868901722180812452, guid: 049c8ee63f2af4be388d5b3b836572be, type: 3}
1907+
- target: {fileID: 1969532709888132574, guid: dcf1e1c889f33e04a89f91b0d43b8891, type: 3}
1908+
propertyPath: yourLevelPrefab
1909+
value:
1910+
objectReference: {fileID: 868901722180812452, guid: 049c8ee63f2af4be388d5b3b836572be, type: 3}
19071911
- target: {fileID: 1969532709888132574, guid: dcf1e1c889f33e04a89f91b0d43b8891, type: 3}
19081912
propertyPath: levelsConfigs.Array.size
19091913
value: 2
@@ -2027,7 +2031,7 @@ MonoBehaviour:
20272031
m_OnCullStateChanged:
20282032
m_PersistentCalls:
20292033
m_Calls: []
2030-
m_text: Finish(W)
2034+
m_text: Finish(F)
20312035
m_isRightToLeft: 0
20322036
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
20332037
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
@@ -2054,12 +2058,12 @@ MonoBehaviour:
20542058
m_faceColor:
20552059
serializedVersion: 2
20562060
rgba: 4294967295
2057-
m_fontSize: 49.8
2061+
m_fontSize: 50
20582062
m_fontSizeBase: 24
20592063
m_fontWeight: 400
20602064
m_enableAutoSizing: 1
2061-
m_fontSizeMin: 2.24
2062-
m_fontSizeMax: 65.12
2065+
m_fontSizeMin: 2.3
2066+
m_fontSizeMax: 50
20632067
m_fontStyle: 0
20642068
m_HorizontalAlignment: 2
20652069
m_VerticalAlignment: 512

Package/GameManager/Runtime/Demo/GameManagerSample.unity.meta

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
%YAML 1.1
2+
%TAG !u! tag:unity3d.com,2011:
3+
--- !u!114 &11400000
4+
MonoBehaviour:
5+
m_ObjectHideFlags: 0
6+
m_CorrespondingSourceObject: {fileID: 0}
7+
m_PrefabInstance: {fileID: 0}
8+
m_PrefabAsset: {fileID: 0}
9+
m_GameObject: {fileID: 0}
10+
m_Enabled: 1
11+
m_EditorHideFlags: 0
12+
m_Script: {fileID: 11500000, guid: 4553002091f7a43dc9120b0a2613af66, type: 3}
13+
m_Name: GameManagerDemoLevel1
14+
m_EditorClassIdentifier:
15+
Dummy: {fileID: 7923328704068599571, guid: d21e9263a93164b52b663deac25ffff3, type: 3}
16+
SecondDummy: {fileID: 6033949169001125516, guid: 64c030c54d7644291901f73da11cc727, type: 3}

Package/GameManager/Runtime/Demo/Resources/GameManagerDemoLevel1.asset.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
%YAML 1.1
2+
%TAG !u! tag:unity3d.com,2011:
3+
--- !u!114 &11400000
4+
MonoBehaviour:
5+
m_ObjectHideFlags: 0
6+
m_CorrespondingSourceObject: {fileID: 0}
7+
m_PrefabInstance: {fileID: 0}
8+
m_PrefabAsset: {fileID: 0}
9+
m_GameObject: {fileID: 0}
10+
m_Enabled: 1
11+
m_EditorHideFlags: 0
12+
m_Script: {fileID: 11500000, guid: 4553002091f7a43dc9120b0a2613af66, type: 3}
13+
m_Name: GameManagerDemoLevel2
14+
m_EditorClassIdentifier:
15+
Dummy: {fileID: 3784286209265341146, guid: e89c0e2b4cf3640329dd3d6f95c377fb, type: 3}
16+
SecondDummy: {fileID: 7939812191499412142, guid: 9d013762145da410fb84a8dcca509a62, type: 3}

Package/GameManager/Runtime/Demo/Resources/GameManagerDemoLevel2.asset.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,41 @@
1-
using System;
21
using Joyixir.GameManager.Scripts.Level;
32
using TMPro;
43
using UnityEngine;
5-
6-
public class LevelManagerListener : MonoBehaviour
4+
namespace Joyixir.GameManager.Demo
75
{
8-
[SerializeField] private TextMeshProUGUI text;
9-
protected void OnEnable()
6+
public class LevelManagerListener : MonoBehaviour
107
{
11-
LevelManager.OnLevelReady += ShowStart;
12-
LevelManager.OnLevelStart += ShowInGame;
13-
LevelManager.OnLevelFinish += ShowFinish;
14-
}
8+
[SerializeField] private TextMeshProUGUI text;
9+
protected void OnEnable()
10+
{
11+
LevelManager.OnLevelReady += ShowStart;
12+
LevelManager.OnLevelStart += ShowInGame;
13+
LevelManager.OnLevelFinish += ShowFinish;
14+
}
1515

16-
private void ShowFinish(LevelData data)
17-
{
18-
text.SetText(data.ToString());
19-
Debug.Log(text.text);
20-
}
16+
private void ShowFinish(LevelData data)
17+
{
18+
text.SetText(data.ToString());
19+
Debug.Log(text.text);
20+
}
2121

22-
private void ShowInGame()
23-
{
24-
text.SetText("InGame");
25-
Debug.Log(text.text);
26-
}
22+
private void ShowInGame()
23+
{
24+
text.SetText("InGame");
25+
Debug.Log(text.text);
26+
}
2727

28-
private void ShowStart()
29-
{
30-
text.SetText("Ready");
31-
Debug.Log(text.text);
32-
}
28+
private void ShowStart()
29+
{
30+
text.SetText("Ready");
31+
Debug.Log(text.text);
32+
}
3333

34-
protected void OnDisable()
35-
{
36-
LevelManager.OnLevelReady -= ShowStart;
37-
LevelManager.OnLevelStart -= ShowInGame;
38-
LevelManager.OnLevelFinish -= ShowFinish;
34+
protected void OnDisable()
35+
{
36+
LevelManager.OnLevelReady -= ShowStart;
37+
LevelManager.OnLevelStart -= ShowInGame;
38+
LevelManager.OnLevelFinish -= ShowFinish;
39+
}
3940
}
40-
}
41+
}
Lines changed: 56 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,72 @@
11
using Joyixir.GameManager.Scripts.Level;
22
using UnityEngine;
33

4-
public class MyLevel : BaseLevel
4+
namespace Joyixir.GameManager.Demo
55
{
6-
private MyLevelConfig _config;
7-
[SerializeField] private Transform dummyPlacement1;
8-
[SerializeField] private Transform dummyPlacement2;
9-
public override void InitializeLevel(BaseLevelConfig config) // Before starting the level. (Usually behind start panel)
6+
public class MyLevel : BaseLevel
107
{
11-
base.InitializeLevel(config);
12-
_config = (MyLevelConfig)config;
13-
InstantiateSomeLevelThings();
14-
}
8+
private MyLevelConfig _config;
9+
[SerializeField] private Transform dummyPlacement1;
10+
[SerializeField] private Transform dummyPlacement2;
11+
public override void InitializeLevel(BaseLevelConfig config) // Before starting the level. (Usually behind start panel)
12+
{
13+
base.InitializeLevel(config);
14+
_config = (MyLevelConfig)config;
15+
InstantiateSomeLevelThings();
16+
}
1517

16-
private void InstantiateSomeLevelThings()
17-
{
18-
GameObject.Instantiate(_config.Dummy, dummyPlacement1);
19-
GameObject.Instantiate(_config.SecondDummy, dummyPlacement2);
20-
}
18+
private void InstantiateSomeLevelThings()
19+
{
20+
GameObject.Instantiate(_config.Dummy, dummyPlacement1);
21+
GameObject.Instantiate(_config.SecondDummy, dummyPlacement2);
22+
}
2123

22-
protected internal override void StartLevel() // When click on start
23-
{
24-
base.StartLevel();
25-
}
24+
protected internal override void StartLevel() // When click on start
25+
{
26+
base.StartLevel();
27+
}
2628

27-
protected override void FillVariables()
28-
{
29-
base.FillVariables();
30-
}
29+
protected override void FillVariables()
30+
{
31+
base.FillVariables();
32+
}
3133

32-
protected internal override void FinishLevel()
33-
{
34-
base.FinishLevel();
35-
}
34+
protected internal override void FinishLevel()
35+
{
36+
base.FinishLevel();
37+
}
3638

37-
protected override void SubscribeToLevelRelatedEvents() // For example, listen to what player does
38-
{
39-
}
39+
protected override void SubscribeToLevelRelatedEvents() // For example, listen to what player does
40+
{
41+
}
4042

41-
protected override void UnSubscribeFromLevelRelatedEvents()
42-
{
43-
}
43+
protected override void UnSubscribeFromLevelRelatedEvents()
44+
{
45+
}
4446

45-
protected internal override int CalculateEarnedMoney()
46-
{
47-
return 10; // Your estimate
48-
}
47+
protected internal override int CalculateEarnedMoney()
48+
{
49+
return 10; // Your estimate
50+
}
4951

50-
protected internal override float CalculateSatisfaction()
51-
{
52-
return .5f; // Your estimate
53-
}
52+
protected internal override float CalculateSatisfaction()
53+
{
54+
return .5f; // Your estimate
55+
}
5456

55-
protected internal override int CalculateScore()
56-
{
57-
return 100; // Your estimate
58-
}
57+
protected internal override int CalculateScore()
58+
{
59+
return 100; // Your estimate
60+
}
5961

60-
protected internal override bool IsWon()
61-
{
62-
return CalculateSatisfaction() > .6f; // Your rules
62+
protected internal override bool IsWon()
63+
{
64+
return CalculateSatisfaction() > .6f; // Your rules
65+
}
66+
67+
protected internal override void PrepareUIRequirementsabstract()
68+
{
69+
// Ui can implement your level UI here
70+
}
6371
}
64-
}
72+
}
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
using Joyixir.GameManager.Scripts.Level;
22
using UnityEngine;
33

4-
[CreateAssetMenu(fileName = "Level", menuName = "My Level Config", order = 0)]
5-
public class MyLevelConfig : BaseLevelConfig
4+
namespace Joyixir.GameManager.Demo
65
{
7-
public GameObject Dummy;
8-
public GameObject SecondDummy;
9-
}
6+
[CreateAssetMenu(fileName = "GameManagerDemoLevel", menuName = "Joyixir/GameManager/Demo/Levels", order = 0)]
7+
public class MyLevelConfig : BaseLevelConfig
8+
{
9+
public GameObject Dummy;
10+
public GameObject SecondDummy;
11+
}
12+
}

0 commit comments

Comments
 (0)