Commit 84f0cd39 authored by 16이상민's avatar 16이상민

Remove Singleton Game Script

parent 576bdb3b
...@@ -1519,7 +1519,6 @@ GameObject: ...@@ -1519,7 +1519,6 @@ GameObject:
m_Component: m_Component:
- component: {fileID: 750753103} - component: {fileID: 750753103}
- component: {fileID: 750753105} - component: {fileID: 750753105}
- component: {fileID: 750753106}
- component: {fileID: 750753107} - component: {fileID: 750753107}
- component: {fileID: 750753108} - component: {fileID: 750753108}
- component: {fileID: 750753109} - component: {fileID: 750753109}
...@@ -1571,18 +1570,6 @@ MonoBehaviour: ...@@ -1571,18 +1570,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 6e697643158480b4ba850d906eac1bc2, type: 3} m_Script: {fileID: 11500000, guid: 6e697643158480b4ba850d906eac1bc2, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
--- !u!114 &750753106
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 750753102}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a9d22e7eb4921ca47b18c68e43c0eb6e, type: 3}
m_Name:
m_EditorClassIdentifier:
defaultSound: $
--- !u!114 &750753107 --- !u!114 &750753107
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
......
...@@ -488,7 +488,6 @@ GameObject: ...@@ -488,7 +488,6 @@ GameObject:
serializedVersion: 5 serializedVersion: 5
m_Component: m_Component:
- component: {fileID: 609057691} - component: {fileID: 609057691}
- component: {fileID: 609057690}
- component: {fileID: 609057689} - component: {fileID: 609057689}
m_Layer: 0 m_Layer: 0
m_Name: Managers m_Name: Managers
...@@ -519,18 +518,6 @@ MonoBehaviour: ...@@ -519,18 +518,6 @@ MonoBehaviour:
- {fileID: 2800000, guid: 70208bf410b6ec2429bfba715fc33842, type: 3} - {fileID: 2800000, guid: 70208bf410b6ec2429bfba715fc33842, type: 3}
Artist: {fileID: 1505678207} Artist: {fileID: 1505678207}
BPM: {fileID: 1378665695} BPM: {fileID: 1378665695}
--- !u!114 &609057690
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 609057688}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a9d22e7eb4921ca47b18c68e43c0eb6e, type: 3}
m_Name:
m_EditorClassIdentifier:
defaultSound: {fileID: 0}
--- !u!4 &609057691 --- !u!4 &609057691
Transform: Transform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
......
using JudgeModule; using JudgeModule;
using System.Collections.Generic; using System.Collections.Generic;
using TrackAnalysis;
using UnityEngine.SceneManagement;
public static class AllSceneManager public static class AllSceneManager
{ {
...@@ -44,6 +46,9 @@ public static class AllSceneManager ...@@ -44,6 +46,9 @@ public static class AllSceneManager
} }
} }
public static TrackInfo CurrentTrack
= new TrackInfo("Assets/Tracks/Tutorial/temp2.bpe");
public static void InitJudgeResult() public static void InitJudgeResult()
{ {
combo = 0; combo = 0;
...@@ -51,4 +56,9 @@ public static class AllSceneManager ...@@ -51,4 +56,9 @@ public static class AllSceneManager
Score = 0; Score = 0;
Judge.JudgeList.ForEach(x => JudgeCount[x] = 0); Judge.JudgeList.ForEach(x => JudgeCount[x] = 0);
} }
public static void SceneTransition(string sceneName)
{
SceneManager.LoadScene("Scene/" + sceneName, LoadSceneMode.Single);
}
} }
\ No newline at end of file
...@@ -7,7 +7,7 @@ public class EndGame : MonoBehaviour ...@@ -7,7 +7,7 @@ public class EndGame : MonoBehaviour
if(Input.GetKeyDown(KeyCode.P)) if(Input.GetKeyDown(KeyCode.P))
{ {
Destroy(this); Destroy(this);
GameManager.Instance.SceneTransition("Result"); AllSceneManager.SceneTransition("Result");
} }
} }
} }
...@@ -15,28 +15,15 @@ public class GameManager : MonoBehaviour { ...@@ -15,28 +15,15 @@ public class GameManager : MonoBehaviour {
if (instance == null) if (instance == null)
instance = new GameObject().AddComponent<GameManager>(); instance = new GameObject().AddComponent<GameManager>();
instance.CurrentTrack
= new TrackInfo("Assets/Tracks/Tutorial/temp2.bpe");
} }
return instance; return instance;
} }
} }
[SerializeField]
public string defaultSound;
public TrackInfo CurrentTrack { get; set; }
// Use this for initialization // Use this for initialization
void Start() void Start()
{ {
DontDestroyOnLoad(Instance); DontDestroyOnLoad(Instance);
} }
public void SceneTransition(string sceneName, bool additive = false)
{
SceneManager.LoadScene("Scene/" + sceneName,
additive ? LoadSceneMode.Additive : LoadSceneMode.Single);
}
} }
...@@ -51,13 +51,13 @@ public class InGameManager : MonoBehaviour ...@@ -51,13 +51,13 @@ public class InGameManager : MonoBehaviour
{ {
notemanager = new NoteManager( notemanager = new NoteManager(
objects, objects,
GameManager.Instance.CurrentTrack.BPM, AllSceneManager.CurrentTrack.BPM,
GameManager.Instance.CurrentTrack.LastNote); AllSceneManager.CurrentTrack.LastNote);
judgemanager = new JudgeManager( judgemanager = new JudgeManager(
input, input,
ShowResult, ShowResult,
objects, objects,
GameManager.Instance.CurrentTrack.BPM); AllSceneManager.CurrentTrack.BPM);
} }
private void SetObjectRef() private void SetObjectRef()
...@@ -100,7 +100,7 @@ public class InGameManager : MonoBehaviour ...@@ -100,7 +100,7 @@ public class InGameManager : MonoBehaviour
baseTime = 0f; baseTime = 0f;
IsInitTime = false; IsInitTime = false;
delayBase = (appear.transform.position.x - offset.transform.position.x) delayBase = (appear.transform.position.x - offset.transform.position.x)
* GameManager.Instance.CurrentTrack.BPM / (60 * 1000); * AllSceneManager.CurrentTrack.BPM / (60 * 1000);
} }
private void SetSound() private void SetSound()
...@@ -109,8 +109,8 @@ public class InGameManager : MonoBehaviour ...@@ -109,8 +109,8 @@ public class InGameManager : MonoBehaviour
sounds.transform.Cast<Transform>() sounds.transform.Cast<Transform>()
.ToList() .ToList()
.ForEach(x => x.gameObject.SetActive(false)); .ForEach(x => x.gameObject.SetActive(false));
if (GameManager.Instance.CurrentTrack.BGM != null) if (AllSceneManager.CurrentTrack.BGM != null)
sounds.transform.Find(GameManager.Instance.CurrentTrack.BGM) sounds.transform.Find(AllSceneManager.CurrentTrack.BGM)
.gameObject.SetActive(true); .gameObject.SetActive(true);
} }
...@@ -162,7 +162,7 @@ public class InGameManager : MonoBehaviour ...@@ -162,7 +162,7 @@ public class InGameManager : MonoBehaviour
Destroy(GetComponent<CoordinateMapperManager>()); Destroy(GetComponent<CoordinateMapperManager>());
Destroy(this); Destroy(this);
GameManager.Instance.SceneTransition("Result"); AllSceneManager.SceneTransition("Result");
} }
} }
} }
...@@ -30,7 +30,7 @@ public class ScoreDisplayManager : MonoBehaviour ...@@ -30,7 +30,7 @@ public class ScoreDisplayManager : MonoBehaviour
AllSceneManager.InitJudgeResult(); AllSceneManager.InitJudgeResult();
Destroy(this); Destroy(this);
GameManager.Instance.SceneTransition("SetSelect"); AllSceneManager.SceneTransition("SetSelect");
return; return;
} }
......
...@@ -7,7 +7,7 @@ public class TitleManager : MonoBehaviour ...@@ -7,7 +7,7 @@ public class TitleManager : MonoBehaviour
if (Input.anyKey) if (Input.anyKey)
{ {
Destroy(this); Destroy(this);
GameManager.Instance.SceneTransition("SetSelect"); AllSceneManager.SceneTransition("SetSelect");
return; return;
} }
} }
......
...@@ -136,12 +136,12 @@ public class TrackManager : MonoBehaviour ...@@ -136,12 +136,12 @@ public class TrackManager : MonoBehaviour
{ {
// TODO: disable start button if nothing selected // TODO: disable start button if nothing selected
GameManager.Instance.CurrentTrack = selected.GetComponent<TrackInfoHolder>().trackInfo; AllSceneManager.CurrentTrack = selected.GetComponent<TrackInfoHolder>().trackInfo;
AllSceneManager.InitJudgeResult(); AllSceneManager.InitJudgeResult();
Destroy(this); Destroy(this);
GameManager.Instance.SceneTransition("InGame"); AllSceneManager.SceneTransition("InGame");
} }
private enum KeyDown private enum KeyDown
......
...@@ -204,7 +204,6 @@ PlayerSettings: ...@@ -204,7 +204,6 @@ PlayerSettings:
tvOSSmallIconLayers: [] tvOSSmallIconLayers: []
tvOSSmallIconLayers2x: [] tvOSSmallIconLayers2x: []
tvOSLargeIconLayers: [] tvOSLargeIconLayers: []
tvOSLargeIconLayers2x: []
tvOSTopShelfImageLayers: [] tvOSTopShelfImageLayers: []
tvOSTopShelfImageLayers2x: [] tvOSTopShelfImageLayers2x: []
tvOSTopShelfImageWideLayers: [] tvOSTopShelfImageWideLayers: []
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment