Commit af445032 authored by 18신대성's avatar 18신대성

인게임 메뉴 만들고 ESC로 열수 있게 함,

1-4에 그에 대한 설명 추가
parent d96213fa
No related merge requests found
{"objects":[{"tag":0,"xPos":25.0,"yPos":0.0},{"tag":2,"xPos":-1.0,"yPos":-0.5},{"tag":3,"xPos":0.0,"yPos":-0.5},{"tag":1,"xPos":-1.0,"yPos":0.0},{"tag":1,"xPos":-1.0,"yPos":-1.0},{"tag":1,"xPos":0.0,"yPos":-1.0},{"tag":1,"xPos":0.0,"yPos":0.0},{"tag":1,"xPos":1.0,"yPos":-1.0},{"tag":1,"xPos":1.0,"yPos":-2.0},{"tag":1,"xPos":1.0,"yPos":2.0},{"tag":9,"xPos":1.0,"yPos":2.0},{"tag":4,"xPos":-1.0,"yPos":-1.0}],"clears":[{"type":0,"goal":1}],"cases":[],"bullets":[1],"comments":"커서를 올려 새로운 총알에 대한 설명을 확인하십시오."}
\ No newline at end of file
{"objects":[{"tag":0,"xPos":25.0,"yPos":0.0},{"tag":2,"xPos":-1.0,"yPos":-0.5},{"tag":3,"xPos":0.0,"yPos":-0.5},{"tag":1,"xPos":-1.0,"yPos":0.0},{"tag":1,"xPos":-1.0,"yPos":-1.0},{"tag":1,"xPos":0.0,"yPos":-1.0},{"tag":1,"xPos":0.0,"yPos":0.0},{"tag":1,"xPos":1.0,"yPos":-1.0},{"tag":1,"xPos":1.0,"yPos":-2.0},{"tag":1,"xPos":1.0,"yPos":2.0},{"tag":9,"xPos":1.0,"yPos":2.0},{"tag":4,"xPos":-1.0,"yPos":-1.0}],"clears":[{"type":0,"goal":1}],"cases":[],"bullets":[1],"comments":"커서를 올려 새로운 총알에 대한 설명을 확인하십시오.\n좌측 상단의 버튼이나 ESC키를 눌러 메뉴를 열 수 있습니다."}
\ No newline at end of file
This diff is collapsed.
......@@ -542,5 +542,21 @@ PrefabInstance:
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 209951667, guid: 8115fd4d1a1025b4fb05e45fc5fa6578, type: 3}
propertyPath: m_Color.r
value: 0.41509432
objectReference: {fileID: 0}
- target: {fileID: 209951667, guid: 8115fd4d1a1025b4fb05e45fc5fa6578, type: 3}
propertyPath: m_Color.g
value: 0.41509432
objectReference: {fileID: 0}
- target: {fileID: 209951667, guid: 8115fd4d1a1025b4fb05e45fc5fa6578, type: 3}
propertyPath: m_Color.b
value: 0.41509432
objectReference: {fileID: 0}
- target: {fileID: 209951667, guid: 8115fd4d1a1025b4fb05e45fc5fa6578, type: 3}
propertyPath: m_Color.a
value: 0.8745098
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 8115fd4d1a1025b4fb05e45fc5fa6578, type: 3}
......@@ -171,7 +171,7 @@ public class CameraController : MonoBehaviour
// Update is called once per frame
void Update()
{
if (!GameManager.inst.isZooming)
if (!GameManager.inst.isGameOver && !GameManager.inst.isZooming)
{
if (!GameManager.inst.isPlayerShooting)
{
......
......@@ -18,6 +18,7 @@ public class GameManager : SingletonBehaviour<GameManager>
public ClearUIGenerator uiGenerator;
public BulletUIGenerator bulletUIGenerator;
public CommentUIGenerator commentUIGenerator;
public MenuUIController menuUIController;
public Image whiteout;
public GameObject clearUI;
public GameObject clearUInextBtn;
......@@ -60,6 +61,7 @@ public class GameManager : SingletonBehaviour<GameManager>
public void StartStage()
{
MapManager.inst.LoadMap(currentStage);
menuUIController.titleText.text = "Stage\n" + (stageStrIdx.Replace("_", " - "));
StartCoroutine(Whiteout(false));
}
......
......@@ -186,7 +186,7 @@ public class Player : MonoBehaviour
// Update is called once per frame
void Update()
{
if (PlayerController.inst.currentPlayer == this && GameManager.inst.isPlayerShooting && !GameManager.inst.isZooming)
if (!GameManager.inst.isGameOver && PlayerController.inst.currentPlayer == this && GameManager.inst.isPlayerShooting && !GameManager.inst.isZooming)
{
laser.transform.position = shootingFinger.transform.position;
if (currentBullet == null && lastShoot + 1f < Time.time)
......
......@@ -247,12 +247,4 @@ public class StageSelector : SingletonBehaviour<StageSelector>
GenerateStageUI();
selectedStage = "0_0";
}
void OnEnable()
{
if (inst.isLoaded)
{
mainScreen.SetActive(false);
}
}
}
......@@ -77,16 +77,8 @@ public class MainScreenControl : MonoBehaviour
public void ToggleTurnOffMenu(bool forceOff = false)
{
if (forceOff || isTurnOffMenuOn)
{
offMenu.SetActive(false);
isTurnOffMenuOn = false;
}
else
{
offMenu.SetActive(true);
isTurnOffMenuOn = true;
}
offMenu.SetActive(!(forceOff || isTurnOffMenuOn));
isTurnOffMenuOn = !(forceOff || isTurnOffMenuOn);
}
public void TurnOff()
{
......@@ -99,15 +91,7 @@ public class MainScreenControl : MonoBehaviour
public void ToggleSettingMenu(bool forceOff = false)
{
if (forceOff || isSettingMenuOn)
{
settingMenu.SetActive(false);
isSettingMenuOn = false;
}
else
{
settingMenu.SetActive(true);
isSettingMenuOn = true;
}
settingMenu.SetActive(!(forceOff || isSettingMenuOn));
isSettingMenuOn = !(forceOff || isSettingMenuOn);
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class MenuUIController : MonoBehaviour
{
public bool isMenuOn = false;
public GameObject menuObject;
public Text titleText;
[SerializeField]
private bool wasCursorLocked = false;
public void ToggleMenu(bool forceClose = false)
{
menuObject.SetActive(!(forceClose || isMenuOn));
isMenuOn = !(forceClose || isMenuOn);
if (wasCursorLocked)
{
Cursor.visible = false;
Cursor.lockState = CursorLockMode.Locked;
wasCursorLocked = false;
GameManager.inst.isGameOver = false;
}
else if (Cursor.lockState == CursorLockMode.Locked)
{
wasCursorLocked = true;
Cursor.visible = true;
Cursor.lockState = CursorLockMode.None;
GameManager.inst.isGameOver = true;
}
}
void Update()
{
if (Input.GetKeyDown(KeyCode.Escape))
{
ToggleMenu();
}
}
}
fileFormatVersion: 2
guid: 8f84c4d943a6c54488dfb5ca909e8bd7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
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