You need to sign in or sign up before continuing.
Commit 84f0cd39 authored by 16이상민's avatar 16이상민

Remove Singleton Game Script

parent 576bdb3b
......@@ -1519,7 +1519,6 @@ GameObject:
m_Component:
- component: {fileID: 750753103}
- component: {fileID: 750753105}
- component: {fileID: 750753106}
- component: {fileID: 750753107}
- component: {fileID: 750753108}
- component: {fileID: 750753109}
......@@ -1571,18 +1570,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 6e697643158480b4ba850d906eac1bc2, type: 3}
m_Name:
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
MonoBehaviour:
m_ObjectHideFlags: 0
......
......@@ -488,7 +488,6 @@ GameObject:
serializedVersion: 5
m_Component:
- component: {fileID: 609057691}
- component: {fileID: 609057690}
- component: {fileID: 609057689}
m_Layer: 0
m_Name: Managers
......@@ -519,18 +518,6 @@ MonoBehaviour:
- {fileID: 2800000, guid: 70208bf410b6ec2429bfba715fc33842, type: 3}
Artist: {fileID: 1505678207}
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
Transform:
m_ObjectHideFlags: 0
......
using JudgeModule;
using System.Collections.Generic;
using TrackAnalysis;
using UnityEngine.SceneManagement;
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()
{
combo = 0;
......@@ -51,4 +56,9 @@ public static class AllSceneManager
Score = 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
if(Input.GetKeyDown(KeyCode.P))
{
Destroy(this);
GameManager.Instance.SceneTransition("Result");
AllSceneManager.SceneTransition("Result");
}
}
}
......@@ -14,29 +14,16 @@ public class GameManager : MonoBehaviour {
as GameManager;
if (instance == null)
instance = new GameObject().AddComponent<GameManager>();
instance.CurrentTrack
= new TrackInfo("Assets/Tracks/Tutorial/temp2.bpe");
}
return instance;
}
}
[SerializeField]
public string defaultSound;
public TrackInfo CurrentTrack { get; set; }
// Use this for initialization
void Start()
{
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
{
notemanager = new NoteManager(
objects,
GameManager.Instance.CurrentTrack.BPM,
GameManager.Instance.CurrentTrack.LastNote);
AllSceneManager.CurrentTrack.BPM,
AllSceneManager.CurrentTrack.LastNote);
judgemanager = new JudgeManager(
input,
ShowResult,
objects,
GameManager.Instance.CurrentTrack.BPM);
AllSceneManager.CurrentTrack.BPM);
}
private void SetObjectRef()
......@@ -100,7 +100,7 @@ public class InGameManager : MonoBehaviour
baseTime = 0f;
IsInitTime = false;
delayBase = (appear.transform.position.x - offset.transform.position.x)
* GameManager.Instance.CurrentTrack.BPM / (60 * 1000);
* AllSceneManager.CurrentTrack.BPM / (60 * 1000);
}
private void SetSound()
......@@ -109,8 +109,8 @@ public class InGameManager : MonoBehaviour
sounds.transform.Cast<Transform>()
.ToList()
.ForEach(x => x.gameObject.SetActive(false));
if (GameManager.Instance.CurrentTrack.BGM != null)
sounds.transform.Find(GameManager.Instance.CurrentTrack.BGM)
if (AllSceneManager.CurrentTrack.BGM != null)
sounds.transform.Find(AllSceneManager.CurrentTrack.BGM)
.gameObject.SetActive(true);
}
......@@ -162,7 +162,7 @@ public class InGameManager : MonoBehaviour
Destroy(GetComponent<CoordinateMapperManager>());
Destroy(this);
GameManager.Instance.SceneTransition("Result");
AllSceneManager.SceneTransition("Result");
}
}
}
......@@ -30,7 +30,7 @@ public class ScoreDisplayManager : MonoBehaviour
AllSceneManager.InitJudgeResult();
Destroy(this);
GameManager.Instance.SceneTransition("SetSelect");
AllSceneManager.SceneTransition("SetSelect");
return;
}
......
......@@ -7,7 +7,7 @@ public class TitleManager : MonoBehaviour
if (Input.anyKey)
{
Destroy(this);
GameManager.Instance.SceneTransition("SetSelect");
AllSceneManager.SceneTransition("SetSelect");
return;
}
}
......
......@@ -136,12 +136,12 @@ public class TrackManager : MonoBehaviour
{
// TODO: disable start button if nothing selected
GameManager.Instance.CurrentTrack = selected.GetComponent<TrackInfoHolder>().trackInfo;
AllSceneManager.CurrentTrack = selected.GetComponent<TrackInfoHolder>().trackInfo;
AllSceneManager.InitJudgeResult();
Destroy(this);
GameManager.Instance.SceneTransition("InGame");
AllSceneManager.SceneTransition("InGame");
}
private enum KeyDown
......
......@@ -204,7 +204,6 @@ PlayerSettings:
tvOSSmallIconLayers: []
tvOSSmallIconLayers2x: []
tvOSLargeIconLayers: []
tvOSLargeIconLayers2x: []
tvOSTopShelfImageLayers: []
tvOSTopShelfImageLayers2x: []
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