DEG-15 기본 클래스 생성
This commit is contained in:
parent
a033189b5d
commit
bd44a7cdc5
6
.idea/.idea.Degulleo3D/.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
6
.idea/.idea.Degulleo3D/.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
@ -0,0 +1,6 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="CssInvalidPropertyValue" enabled="true" level="ERROR" enabled_by_default="true" />
|
||||
</profile>
|
||||
</component>
|
8
Assets/KSH.meta
Normal file
8
Assets/KSH.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8899b70334c78204fb97b6da706ac4c6
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
10
Assets/KSH/GameConstants.cs
Normal file
10
Assets/KSH/GameConstants.cs
Normal file
@ -0,0 +1,10 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
|
||||
public class GameConstants : MonoBehaviour
|
||||
{
|
||||
|
||||
}
|
11
Assets/KSH/GameConstants.cs.meta
Normal file
11
Assets/KSH/GameConstants.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1e1682026c3858a4f8974675387aaf5a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
34
Assets/KSH/GameManager.cs
Normal file
34
Assets/KSH/GameManager.cs
Normal file
@ -0,0 +1,34 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public class GameManager : Singleton<GameManager>
|
||||
{
|
||||
private Canvas _canvas;
|
||||
|
||||
public void ChangeToGameScene()
|
||||
{
|
||||
SceneManager.LoadScene("Game"); // 던전 Scene
|
||||
}
|
||||
|
||||
public void ChangeToMainScene()
|
||||
{
|
||||
SceneManager.LoadScene("Housing"); // Home Scene
|
||||
}
|
||||
|
||||
// ToDo: Open Setting Panel 등 Panel 처리
|
||||
|
||||
protected override void OnSceneLoaded(Scene scene, LoadSceneMode mode)
|
||||
{
|
||||
// ToDo: 씬 로드 시 동작 구현. ex: BGM 변경
|
||||
|
||||
// UI용 Canvas 찾기
|
||||
// _canvas = GameObject.FindObjectOfType<Canvas>();
|
||||
}
|
||||
|
||||
private void OnApplicationQuit()
|
||||
{
|
||||
// TODO: 게임 종료 시 로직 추가
|
||||
}
|
||||
}
|
11
Assets/KSH/GameManager.cs.meta
Normal file
11
Assets/KSH/GameManager.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 450038edae05f9b4d94ff56c62444048
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/KSH/PlayerStats.cs
Normal file
8
Assets/KSH/PlayerStats.cs
Normal file
@ -0,0 +1,8 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class PlayerStats : MonoBehaviour
|
||||
{
|
||||
|
||||
}
|
11
Assets/KSH/PlayerStats.cs.meta
Normal file
11
Assets/KSH/PlayerStats.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8bccfaf46267e2544aa4bae52756f182
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
45
Assets/KSH/Singleton.cs
Normal file
45
Assets/KSH/Singleton.cs
Normal file
@ -0,0 +1,45 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public abstract class Singleton<T> : MonoBehaviour where T : Component
|
||||
{
|
||||
private static T _instance;
|
||||
|
||||
public static T Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_instance == null)
|
||||
{
|
||||
_instance = FindObjectOfType<T>();
|
||||
if (_instance == null)
|
||||
{
|
||||
GameObject obj = new GameObject();
|
||||
obj.name = typeof(T).Name;
|
||||
_instance = obj.AddComponent<T>();
|
||||
}
|
||||
}
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
|
||||
void Awake()
|
||||
{
|
||||
if (_instance == null)
|
||||
{
|
||||
_instance = this as T;
|
||||
DontDestroyOnLoad(gameObject); // obj가 destory 안되도록 설정
|
||||
|
||||
// 씬 전환시 호출되는 액션 메서드 할당
|
||||
SceneManager.sceneLoaded += OnSceneLoaded;
|
||||
}
|
||||
else
|
||||
{
|
||||
Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract void OnSceneLoaded(Scene scene, LoadSceneMode mode);
|
||||
}
|
11
Assets/KSH/Singleton.cs.meta
Normal file
11
Assets/KSH/Singleton.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 014fe0082bc24a041a78cce62ba16b5d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
x
Reference in New Issue
Block a user