Untitled
unknown
plain_text
3 years ago
928 B
10
Indexable
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class StageManager : MonoBehaviour
{
public static StageManager Instiance;
public int stageLevel;
// Chapter ve stage kaydetmek. Örnek 1-1 veya 1-3 gibi.
public void SetLevel(int chapter,int stage)
{
DataManager.Instiance.SetData(DataType.Int, "chapter", chapter);
DataManager.Instiance.SetData(DataType.Int, "stage", stage);
}
//Bölüm başında chapterın kaçıncı stageinde olduğunu çekmek
public int GetStage()
{
int stage = DataManager.Instiance.GetIntData("stage");
return stage;
}
//Index numarasından sahneyi yukleyecek.
public void ChapterLoad()
{
int chapter=DataManager.Instiance.GetIntData("chapter");
SceneManager.LoadScene(chapter);
}
}
Editor is loading...