117 lines
3 KiB
C#
Executable file
117 lines
3 KiB
C#
Executable file
using JetBrains.Annotations;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.SceneManagement;
|
|
using UnityEngine.UI;
|
|
|
|
public class saveLevel : MonoBehaviour
|
|
{
|
|
public bool IsReborn;
|
|
public Button[] Level;
|
|
|
|
public Button Boss1;
|
|
|
|
public Button QL1;
|
|
public GameObject OW;
|
|
public int Minus;
|
|
|
|
public int CompleteRight;
|
|
public int CompleteLeft;
|
|
public int CompleteCenter;
|
|
|
|
public Button[] RightLevels;
|
|
public Button[] LeftLevels;
|
|
public Button[] CenterLevels;
|
|
|
|
public int LevelCompl;
|
|
public int NPC0QP;
|
|
|
|
private void Start()
|
|
{
|
|
// QL1.interactable = false;
|
|
|
|
CompleteRight = PlayerPrefs.GetInt("CompleteRightL");
|
|
CompleteLeft = PlayerPrefs.GetInt("CompleteLeftL");
|
|
CompleteCenter = PlayerPrefs.GetInt("CompleteCenterL");
|
|
|
|
|
|
|
|
LevelCompl = PlayerPrefs.GetInt("LevelComplete");
|
|
NPC0QP = PlayerPrefs.GetInt("NPC0QP");
|
|
try
|
|
{
|
|
if (LevelCompl >= 28)
|
|
{
|
|
Boss1.interactable = true;
|
|
}
|
|
else
|
|
{ Boss1.interactable = false; }
|
|
}
|
|
catch { }
|
|
//if (NPC0QP > 1 && LevelCompl >= 15)
|
|
// {
|
|
// QL1.interactable = true;
|
|
// }
|
|
if (OW != null)
|
|
{
|
|
if (LevelCompl > 10)
|
|
{
|
|
OW.SetActive(true);
|
|
}
|
|
else { OW.SetActive(false); }
|
|
}
|
|
if (!IsReborn)
|
|
{
|
|
for (int i = 0; i < Level.Length; i++)
|
|
{
|
|
Level[i].interactable = false;
|
|
Debug.Log(Level[i]);
|
|
}
|
|
for (int i = 0; i <= LevelCompl - Minus; i++)
|
|
{
|
|
Level[i].interactable = true;
|
|
Debug.Log(Level[i]);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
for (int i = 0; i < RightLevels.Length; i++)
|
|
{
|
|
RightLevels[i].interactable = false;
|
|
}
|
|
for (int i = 0; i < LeftLevels.Length; i++)
|
|
{
|
|
LeftLevels[i].interactable = false;
|
|
}
|
|
for (int i = 0; i < CenterLevels.Length; i++)
|
|
{
|
|
CenterLevels[i].interactable = false;
|
|
}
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < CompleteRight; i++)
|
|
{
|
|
RightLevels[i+1].interactable = true;
|
|
}
|
|
for (int i = 0; i < CompleteLeft; i++)
|
|
{
|
|
LeftLevels[i+1].interactable = true;
|
|
}
|
|
LeftLevels[0].interactable = true;
|
|
RightLevels[0].interactable = true;
|
|
//for (int i = 0; i <= CompleteCenter; i++)
|
|
//{
|
|
// CenterLevels[i].interactable = true;
|
|
//}
|
|
if (CompleteLeft >= 20 && CompleteRight >= 10)
|
|
{
|
|
CenterLevels[0].interactable = true;
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|