Commit 5414358c authored by 18손재민's avatar 18손재민 Committed by 18손재민

스테이지 선택 wip, 현재 씬 전환이 제대로 되지 않음

parent 77bda0c2
{"objects":[{"tag":0,"xPos":20.0,"yPos":0.0},{"tag":2,"xPos":-2.0,"yPos":-0.5},{"tag":2,"xPos":-1.0,"yPos":-0.5},{"tag":2,"xPos":0.5,"yPos":-1.0},{"tag":3,"xPos":0.0,"yPos":-0.5},{"tag":3,"xPos":1.0,"yPos":-0.5},{"tag":1,"xPos":-2.0,"yPos":1.0},{"tag":1,"xPos":-1.0,"yPos":1.0},{"tag":1,"xPos":0.0,"yPos":1.0},{"tag":1,"xPos":1.0,"yPos":1.0},{"tag":1,"xPos":1.0,"yPos":0.0},{"tag":1,"xPos":0.0,"yPos":0.0},{"tag":1,"xPos":-1.0,"yPos":0.0},{"tag":1,"xPos":-2.0,"yPos":0.0},{"tag":1,"xPos":-2.0,"yPos":-1.0},{"tag":1,"xPos":-1.0,"yPos":-1.0},{"tag":1,"xPos":0.0,"yPos":-1.0},{"tag":1,"xPos":1.0,"yPos":-1.0},{"tag":1,"xPos":1.0,"yPos":-2.0},{"tag":1,"xPos":0.0,"yPos":-2.0},{"tag":1,"xPos":-1.0,"yPos":-2.0},{"tag":1,"xPos":-2.0,"yPos":-2.0},{"tag":4,"xPos":-2.0,"yPos":-2.0},{"tag":5,"xPos":1.0,"yPos":-2.0},{"tag":6,"xPos":1.0,"yPos":-1.0}],"clears":[{"type":6,"goal":1}],"bullets":[1,1]}
\ No newline at end of file
......@@ -6,7 +6,7 @@ AnimationClip:
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: case_rotate
m_Name: case_idle
serializedVersion: 6
m_Legacy: 0
m_Compressed: 0
......
......@@ -7,7 +7,7 @@ Material:
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: PointColorYellow
m_Name: PointColorGreen
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 4
......
......@@ -7,7 +7,7 @@ Material:
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: PointColorBlack
m_Name: PointColorSilver
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 4
......
......@@ -43,6 +43,8 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: f94477ce50cfef746baa12d77bb9d4eb, type: 3}
m_Name:
m_EditorClassIdentifier:
mirrorMaterial: {fileID: 0}
uiGenerator: {fileID: 0}
clearIndex: 000000000000000000000000000000000000000000000000000000000000000000000000
clearCounter: 0
currentStage: 0
totalStageCount: 3
......@@ -71,3 +71,5 @@ MonoBehaviour:
players: []
stage:
- {fileID: 4900000, guid: e4921fa87e2b8fe44b2246f2b275c88a, type: 3}
- {fileID: 4900000, guid: e4921fa87e2b8fe44b2246f2b275c88a, type: 3}
- {fileID: 4900000, guid: e4921fa87e2b8fe44b2246f2b275c88a, type: 3}
This diff is collapsed.
fileFormatVersion: 2
guid: 32ee0c564afd5274e887a0d0ff2e4ef5
TextScriptImporter:
guid: 8115fd4d1a1025b4fb05e45fc5fa6578
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
......
......@@ -619,6 +619,11 @@ PrefabInstance:
propertyPath: m_Name
value: GameManager
objectReference: {fileID: 0}
- target: {fileID: 52444459818764334, guid: 42247a938bb6e554eb00dc08303a72d6,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 52444459818764335, guid: 42247a938bb6e554eb00dc08303a72d6,
type: 3}
propertyPath: m_LocalPosition.x
......@@ -899,21 +904,11 @@ PrefabInstance:
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 7277015661519863741, guid: 20dee07e28273f049a9093ae4453912f,
type: 3}
propertyPath: m_NavMeshData
value:
objectReference: {fileID: 0}
- target: {fileID: 7277015661519863740, guid: 20dee07e28273f049a9093ae4453912f,
type: 3}
propertyPath: m_Name
value: NavMesh
objectReference: {fileID: 0}
- target: {fileID: 7277015661519863740, guid: 20dee07e28273f049a9093ae4453912f,
type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7277015661519863742, guid: 20dee07e28273f049a9093ae4453912f,
type: 3}
propertyPath: m_LocalPosition.x
......
This diff is collapsed.
fileFormatVersion: 2
guid: 8ecf292f5544cb14e88af57613e2b047
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
......@@ -49,11 +49,6 @@ public class Briefcase : MonoBehaviour, IObject, IPlayerInteractor
}
}
private void OnDestroy()
{
PlayerController.inst.OnPlayerMove -= Interact;
}
public void Interact(Vector2Int position)
{
Debug.Log(Position + " " + position);
......
......@@ -23,11 +23,6 @@ public class CameraTurret : MonoBehaviour, IObject, IBreakable, IPlayerInteracto
MapManager.inst.currentMap.clearConditions[GameManager.nTurret].IsDone(1);
MapManager.inst.currentMap.RemoveObject(Position);
}
private void OnDestroy()
{
PlayerController.inst.OnPlayerMove -= Interact;
}
public void Interact(Vector2Int pos)
{
......
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Linq;
using UnityEngine.SceneManagement;
public class GameManager : SingletonBehaviour<GameManager>
{
public Material mirrorMaterial;
public ClearUIGenerator uiGenerator;
public int[] clearIndex = new int[9];
......@@ -16,6 +15,10 @@ public class GameManager : SingletonBehaviour<GameManager>
/// The index of the current stage.
/// </summary>
public int currentStage;
/// <summary>
/// Max number of stages.
/// </summary>
public int totalStageCount;
public void ResetClearIndex()
{
......@@ -43,6 +46,13 @@ public class GameManager : SingletonBehaviour<GameManager>
black = clearIndex[(int)ClearType.Black];
}
public void StartStage(int _stageIndex)
{
currentStage = _stageIndex;
SceneManager.LoadScene("PlayStage");
MapManager.inst.LoadMap(MapManager.inst.stage[currentStage]);
}
public void ClearStage()
{
Debug.Log("Stage Clear!");
......@@ -63,7 +73,6 @@ public class GameManager : SingletonBehaviour<GameManager>
yield return new WaitForSeconds(0.5f);
GameOver();
MapManager.inst.LoadMap(MapManager.inst.stage[currentStage]);
}
void Awake()
......@@ -74,12 +83,11 @@ public class GameManager : SingletonBehaviour<GameManager>
// Start is called before the first frame update
void Start()
{
currentStage = 0;
MapManager.inst.LoadMap(MapManager.inst.stage[currentStage]);
if (MapManager.inst.isMapEditingOn)
SetStatic();
/*if (MapManager.inst.isMapEditingOn)
{
//Reset clear index to -1.
ResetClearIndex();
}
}*/
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class StageSelector : MonoBehaviour
{
public Text stageIndex;
public void ChangeStage(int i)
{
if(i < 0 && GameManager.inst.currentStage == 0) GameManager.inst.currentStage = GameManager.inst.totalStageCount - 1;
else GameManager.inst.currentStage = (GameManager.inst.currentStage + i) % GameManager.inst.totalStageCount;
stageIndex.text = "Stage : " + GameManager.inst.currentStage;
}
public void StartSelectedStage()
{
GameManager.inst.StartStage(GameManager.inst.currentStage);
}
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}
fileFormatVersion: 2
guid: 36e85e37643ba14409eca35bfaf8989a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
......@@ -6,6 +6,6 @@ EditorBuildSettings:
serializedVersion: 2
m_Scenes:
- enabled: 1
path: Assets/Scenes/SampleScene.unity
path: Assets/Scenes/PlayStage.unity
guid: 2efa712d359ce2746829d35c55eff0d5
m_configObjects: {}
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