关卡解锁逻辑
This commit is contained in:
parent
ca27e3d915
commit
7026dd9f01
|
@ -82,7 +82,7 @@ AnimatorStateMachine:
|
||||||
m_Position: {x: -20, y: 420, z: 0}
|
m_Position: {x: -20, y: 420, z: 0}
|
||||||
- serializedVersion: 1
|
- serializedVersion: 1
|
||||||
m_State: {fileID: 3836889060777042707}
|
m_State: {fileID: 3836889060777042707}
|
||||||
m_Position: {x: 0, y: 590, z: 0}
|
m_Position: {x: 140, y: 520, z: 0}
|
||||||
- serializedVersion: 1
|
- serializedVersion: 1
|
||||||
m_State: {fileID: -6102885615661990480}
|
m_State: {fileID: -6102885615661990480}
|
||||||
m_Position: {x: -30, y: 570, z: 0}
|
m_Position: {x: -30, y: 570, z: 0}
|
||||||
|
@ -191,8 +191,7 @@ AnimatorState:
|
||||||
m_Name: 2_2_2
|
m_Name: 2_2_2
|
||||||
m_Speed: 1
|
m_Speed: 1
|
||||||
m_CycleOffset: 0
|
m_CycleOffset: 0
|
||||||
m_Transitions:
|
m_Transitions: []
|
||||||
- {fileID: 1485549772310524228}
|
|
||||||
m_StateMachineBehaviours: []
|
m_StateMachineBehaviours: []
|
||||||
m_Position: {x: 50, y: 50, z: 0}
|
m_Position: {x: 50, y: 50, z: 0}
|
||||||
m_IKOnFeet: 0
|
m_IKOnFeet: 0
|
||||||
|
@ -374,8 +373,7 @@ AnimatorState:
|
||||||
m_Name: 0
|
m_Name: 0
|
||||||
m_Speed: 1
|
m_Speed: 1
|
||||||
m_CycleOffset: 0
|
m_CycleOffset: 0
|
||||||
m_Transitions:
|
m_Transitions: []
|
||||||
- {fileID: 869676249508705306}
|
|
||||||
m_StateMachineBehaviours: []
|
m_StateMachineBehaviours: []
|
||||||
m_Position: {x: 50, y: 50, z: 0}
|
m_Position: {x: 50, y: 50, z: 0}
|
||||||
m_IKOnFeet: 0
|
m_IKOnFeet: 0
|
||||||
|
@ -569,50 +567,6 @@ AnimatorState:
|
||||||
m_MirrorParameter:
|
m_MirrorParameter:
|
||||||
m_CycleOffsetParameter:
|
m_CycleOffsetParameter:
|
||||||
m_TimeParameter:
|
m_TimeParameter:
|
||||||
--- !u!1101 &869676249508705306
|
|
||||||
AnimatorStateTransition:
|
|
||||||
m_ObjectHideFlags: 1
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_Name:
|
|
||||||
m_Conditions: []
|
|
||||||
m_DstStateMachine: {fileID: 0}
|
|
||||||
m_DstState: {fileID: 7665055686205544356}
|
|
||||||
m_Solo: 0
|
|
||||||
m_Mute: 0
|
|
||||||
m_IsExit: 0
|
|
||||||
serializedVersion: 3
|
|
||||||
m_TransitionDuration: 0
|
|
||||||
m_TransitionOffset: 0
|
|
||||||
m_ExitTime: 1
|
|
||||||
m_HasExitTime: 1
|
|
||||||
m_HasFixedDuration: 1
|
|
||||||
m_InterruptionSource: 0
|
|
||||||
m_OrderedInterruption: 1
|
|
||||||
m_CanTransitionToSelf: 1
|
|
||||||
--- !u!1101 &1485549772310524228
|
|
||||||
AnimatorStateTransition:
|
|
||||||
m_ObjectHideFlags: 1
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_Name:
|
|
||||||
m_Conditions: []
|
|
||||||
m_DstStateMachine: {fileID: 0}
|
|
||||||
m_DstState: {fileID: 3836889060777042707}
|
|
||||||
m_Solo: 0
|
|
||||||
m_Mute: 0
|
|
||||||
m_IsExit: 0
|
|
||||||
serializedVersion: 3
|
|
||||||
m_TransitionDuration: 0
|
|
||||||
m_TransitionOffset: 0
|
|
||||||
m_ExitTime: 1
|
|
||||||
m_HasExitTime: 1
|
|
||||||
m_HasFixedDuration: 1
|
|
||||||
m_InterruptionSource: 0
|
|
||||||
m_OrderedInterruption: 1
|
|
||||||
m_CanTransitionToSelf: 1
|
|
||||||
--- !u!1102 &3369929957660876854
|
--- !u!1102 &3369929957660876854
|
||||||
AnimatorState:
|
AnimatorState:
|
||||||
serializedVersion: 6
|
serializedVersion: 6
|
||||||
|
|
|
@ -64,6 +64,7 @@ public class GameLogic : MonoBehaviour
|
||||||
if (tEndingID >= 0)
|
if (tEndingID >= 0)
|
||||||
{
|
{
|
||||||
PlayerData.Instance.AddEnding(PlayerData.Instance.CurrentLevelID, tEndingID);
|
PlayerData.Instance.AddEnding(PlayerData.Instance.CurrentLevelID, tEndingID);
|
||||||
|
PlayerData.Instance.UnlockNewLevel();
|
||||||
|
|
||||||
EndingData tEdData = tLvData.Endings[tEndingID];
|
EndingData tEdData = tLvData.Endings[tEndingID];
|
||||||
tUIResult.Init(PlayerData.Instance.CurrentLevelID, tEdData.EndingName, tEdData.IsGoodEnding, false);
|
tUIResult.Init(PlayerData.Instance.CurrentLevelID, tEdData.EndingName, tEdData.IsGoodEnding, false);
|
||||||
|
|
|
@ -14,4 +14,10 @@ public class GameManager : D_MonoSingleton<GameManager>
|
||||||
{
|
{
|
||||||
SceneManager.LoadScene("Game");
|
SceneManager.LoadScene("Game");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void NextLevel()
|
||||||
|
{
|
||||||
|
PlayerData.Instance.CurrentLevel++;
|
||||||
|
LoadGame();
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -18,6 +18,15 @@ public class PlayerData : StorageBase<PlayerData>
|
||||||
}
|
}
|
||||||
[SerializeField]private int mCurrentLevel = 1;
|
[SerializeField]private int mCurrentLevel = 1;
|
||||||
|
|
||||||
|
public int UnlockedLevel
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return mUnlockedLevel;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
[SerializeField] private int mUnlockedLevel = 1;
|
||||||
|
|
||||||
public int CurrentLevelID
|
public int CurrentLevelID
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
@ -28,6 +37,14 @@ public class PlayerData : StorageBase<PlayerData>
|
||||||
|
|
||||||
[SerializeField] private Dictionary<int, List<int>> mEndingDic = new Dictionary<int, List<int>>();
|
[SerializeField] private Dictionary<int, List<int>> mEndingDic = new Dictionary<int, List<int>>();
|
||||||
|
|
||||||
|
public void UnlockNewLevel()
|
||||||
|
{
|
||||||
|
if (mUnlockedLevel < GameConfig.Instance.LevelSort.Count)
|
||||||
|
{
|
||||||
|
mUnlockedLevel++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public bool AddEnding(int pLevelID, int pEndingID)
|
public bool AddEnding(int pLevelID, int pEndingID)
|
||||||
{
|
{
|
||||||
if (!mEndingDic.ContainsKey(pLevelID))
|
if (!mEndingDic.ContainsKey(pLevelID))
|
||||||
|
|
|
@ -106,6 +106,10 @@ public class PanelGame : BasePanel
|
||||||
{
|
{
|
||||||
mGobPlay.SetActive(false);
|
mGobPlay.SetActive(false);
|
||||||
mGobOpMask.SetActive(true);
|
mGobOpMask.SetActive(true);
|
||||||
|
for (int i = 0; i < mBtnSlots.Length; i++)
|
||||||
|
{
|
||||||
|
mBtnSlots[i].ShowCurrent(false);
|
||||||
|
}
|
||||||
|
|
||||||
mAni.ReadyPlay(0.5f);
|
mAni.ReadyPlay(0.5f);
|
||||||
TimerManager.Instance.Schedule(Action, 0.5f);
|
TimerManager.Instance.Schedule(Action, 0.5f);
|
||||||
|
|
|
@ -60,7 +60,7 @@ public class PanelResult : BasePanel
|
||||||
|
|
||||||
private void OnClickNext()
|
private void OnClickNext()
|
||||||
{
|
{
|
||||||
GameManager.Instance.LoadGame();
|
GameManager.Instance.NextLevel();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnClickChoose()
|
private void OnClickChoose()
|
||||||
|
|
Loading…
Reference in New Issue