diff --git a/Gameton-06/Assets/Gameton/Scripts/GameData/StageClearData.cs b/Gameton-06/Assets/Gameton/Scripts/GameData/StageClearData.cs new file mode 100644 index 00000000..c39c91a1 --- /dev/null +++ b/Gameton-06/Assets/Gameton/Scripts/GameData/StageClearData.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace TON +{ + [System.Serializable] + public class StageClearData + { + // 스테이지 클리어 데이터의 고유 id + public string id; + // 클리어한 캐릭터 아이디 + public string characterId; + // 클리어한 스테이지 아이디 + public string stageId; + // 클리어에 소요된 시간 + public int clearTime; + // 클리어 시간에 따른 별점 + public int starRating; + // 클리어한 날짜와 시간 정보 + public string dateTime; + + public StageClearData(string characterId, string stageId, int clearTime, int starRating) + { + id = $"SC{DateTime.UtcNow:yyyyMMddHHmmss}-{characterId}-{stageId}"; + this.characterId = characterId; + this.stageId = stageId; + this.clearTime = clearTime; + this.starRating = starRating; + dateTime = DateTime.UtcNow.ToString(); + } + } +} diff --git a/Gameton-06/Assets/Gameton/Scripts/GameData/StageClearData.cs.meta b/Gameton-06/Assets/Gameton/Scripts/GameData/StageClearData.cs.meta new file mode 100644 index 00000000..054c407e --- /dev/null +++ b/Gameton-06/Assets/Gameton/Scripts/GameData/StageClearData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5104aacb801da7541b35699566b60c27 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Gameton-06/Assets/Gameton/Scripts/GameStage.meta b/Gameton-06/Assets/Gameton/Scripts/GameStage.meta new file mode 100644 index 00000000..49786252 --- /dev/null +++ b/Gameton-06/Assets/Gameton/Scripts/GameStage.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e49ed8f442a8e9942852de004d7c393e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Gameton-06/Assets/Gameton/Scripts/GameStage/StageManager.cs b/Gameton-06/Assets/Gameton/Scripts/GameStage/StageManager.cs new file mode 100644 index 00000000..4c5d2fef --- /dev/null +++ b/Gameton-06/Assets/Gameton/Scripts/GameStage/StageManager.cs @@ -0,0 +1,37 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace TON +{ + public class StageManager : SingletonBase + { + + private float stageStartTime; // 스테이지 시작 시간 + + public void StartStage() + { + stageStartTime = Time.time; + } + + public int GetStarCount() + { + float elapsedTime = Time.time - stageStartTime; + + if (elapsedTime <= 180f) + return 3; + else if (elapsedTime <= 300f) + return 2; + else + return 1; + } + + public void StageClear() + { + int starCount = GetStarCount(); + Debug.Log($"스테이지 클리어! 별 개수: {starCount}"); + // UI 업데이트, 데이터 저장 로직 추가 가능 + } + + } +} diff --git a/Gameton-06/Assets/Gameton/Scripts/GameStage/StageManager.cs.meta b/Gameton-06/Assets/Gameton/Scripts/GameStage/StageManager.cs.meta new file mode 100644 index 00000000..4642c621 --- /dev/null +++ b/Gameton-06/Assets/Gameton/Scripts/GameStage/StageManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ba51d02d7e3fec3448ca66e3eed1f921 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: