Commit 3d7c5622 authored by 18손재민's avatar 18손재민

타이틀 씬 만듬

parent f2d60d26
...@@ -34,7 +34,7 @@ Transform: ...@@ -34,7 +34,7 @@ Transform:
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1704656476422024} m_GameObject: {fileID: 1704656476422024}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 144, y: 0, z: -2} m_LocalPosition: {x: 192, y: 0, z: -2}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
......
This diff is collapsed.
fileFormatVersion: 2
guid: 1ff9b440e69e4bf4ea0467f07343403f
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections; using System.Collections;
using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using UnityEngine.SceneManagement; using UnityEngine.SceneManagement;
...@@ -11,6 +10,9 @@ public class GameManager : Singleton<GameManager> { ...@@ -11,6 +10,9 @@ public class GameManager : Singleton<GameManager> {
/// </summary> /// </summary>
public static GameState gameState; public static GameState gameState;
/// <summary>
/// Position where portal would spawn player.
/// </summary>
Vector3 spawnPosition = new Vector3(2, 1, 0); Vector3 spawnPosition = new Vector3(2, 1, 0);
public GameObject minimap; public GameObject minimap;
...@@ -21,7 +23,11 @@ public class GameManager : Singleton<GameManager> { ...@@ -21,7 +23,11 @@ public class GameManager : Singleton<GameManager> {
// Constructor - protect calling raw constructor // Constructor - protect calling raw constructor
protected GameManager() { } protected GameManager() { }
public IEnumerator StartGame() /// <summary>
/// Ends the tutorial and start real game.
/// </summary>
/// <returns></returns>
public IEnumerator EndTutorial()
{ {
yield return new WaitForSeconds(1f); yield return new WaitForSeconds(1f);
gameState = GameState.Ingame; gameState = GameState.Ingame;
...@@ -32,6 +38,9 @@ public class GameManager : Singleton<GameManager> { ...@@ -32,6 +38,9 @@ public class GameManager : Singleton<GameManager> {
GameObject.Find("Main Camera").transform.position = GameObject.Find("Player").transform.position + new Vector3(0, 0, -1); GameObject.Find("Main Camera").transform.position = GameObject.Find("Player").transform.position + new Vector3(0, 0, -1);
} }
/// <summary>
/// Restarts the game.
/// </summary>
public void RestartGame() public void RestartGame()
{ {
SceneManager.LoadScene("PlayScene"); SceneManager.LoadScene("PlayScene");
...@@ -39,7 +48,7 @@ public class GameManager : Singleton<GameManager> { ...@@ -39,7 +48,7 @@ public class GameManager : Singleton<GameManager> {
void Awake() void Awake()
{ {
//DontDestroyOnLoad(gameObject);
} }
// Use this for initialization // Use this for initialization
......
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class MenuManager : MonoBehaviour {
public void StartGame()
{
SceneManager.LoadScene("PlayScene");
}
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
}
fileFormatVersion: 2
guid: c29f8fff47d4559458612f7f39d777aa
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
...@@ -12,13 +12,14 @@ public class Portal : MonoBehaviour, IPlayerInteraction { ...@@ -12,13 +12,14 @@ public class Portal : MonoBehaviour, IPlayerInteraction {
StartCoroutine(GameObject.FindGameObjectWithTag("MainCamera").GetComponent<CameraController>().ChangeScene(GameState.Portal)); StartCoroutine(GameObject.FindGameObjectWithTag("MainCamera").GetComponent<CameraController>().ChangeScene(GameState.Portal));
else if (GameManager.gameState == GameState.Tutorial && !isPortalUsed) else if (GameManager.gameState == GameState.Tutorial && !isPortalUsed)
{ {
StartCoroutine(GameManager.Instance.EndTutorial());
isPortalUsed = true; isPortalUsed = true;
StartCoroutine(GameManager.Instance.StartGame());
} }
} }
public void HighlightSwitch(bool enabled) public void HighlightSwitch(bool enabled)
{ {
} }
// Use this for initialization // Use this for initialization
......
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