Commit c4a6c63c authored by 15박보승's avatar 15박보승

맵에디터에서 서류 가방 생성시 총알 종류를 담을 수 있게 함

parent 3a7c3ccf
{"objects":[{"tag":0,"xPos":25.0,"yPos":0.0},{"tag":2,"xPos":-2.0,"yPos":1.5},{"tag":2,"xPos":-1.0,"yPos":1.5},{"tag":3,"xPos":0.0,"yPos":1.5},{"tag":3,"xPos":1.0,"yPos":1.5},{"tag":1,"xPos":0.0,"yPos":0.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":-2.0,"yPos":2.0},{"tag":1,"xPos":-2.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":0.0,"yPos":1.0},{"tag":1,"xPos":1.0,"yPos":1.0},{"tag":1,"xPos":1.0,"yPos":2.0},{"tag":1,"xPos":2.0,"yPos":2.0},{"tag":1,"xPos":2.0,"yPos":1.0},{"tag":1,"xPos":2.0,"yPos":0.0},{"tag":1,"xPos":2.0,"yPos":-1.0},{"tag":1,"xPos":2.0,"yPos":-2.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":-1.0,"yPos":-1.0},{"tag":1,"xPos":-2.0,"yPos":-1.0},{"tag":9,"xPos":-2.0,"yPos":-1.0},{"tag":1,"xPos":-2.0,"yPos":-2.0},{"tag":1,"xPos":-2.0,"yPos":0.0},{"tag":9,"xPos":-2.0,"yPos":0.0},{"tag":1,"xPos":-1.0,"yPos":0.0},{"tag":4,"xPos":-2.0,"yPos":-2.0},{"tag":4,"xPos":-1.0,"yPos":-2.0},{"tag":6,"xPos":2.0,"yPos":2.0},{"tag":7,"xPos":2.0,"yPos":1.0},{"tag":8,"xPos":2.0,"yPos":0.0},{"tag":5,"xPos":1.0,"yPos":1.0},{"tag":5,"xPos":1.0,"yPos":0.0},{"tag":5,"xPos":1.0,"yPos":-1.0},{"tag":5,"xPos":1.0,"yPos":-2.0}],"clears":[],"cases":[3,0,1,2],"bullets":[0,1,2]}
\ No newline at end of file
fileFormatVersion: 2
guid: e4921fa87e2b8fe44b2246f2b275c88a
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
...@@ -1138,7 +1138,7 @@ PrefabInstance: ...@@ -1138,7 +1138,7 @@ PrefabInstance:
type: 3} type: 3}
propertyPath: stage.Array.data[0] propertyPath: stage.Array.data[0]
value: value:
objectReference: {fileID: 4900000, guid: 61078fd8d06379c47b9709f2ed3a3290, type: 3} objectReference: {fileID: 4900000, guid: e4921fa87e2b8fe44b2246f2b275c88a, type: 3}
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 11285456de5f1854d947bea83275646f, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 11285456de5f1854d947bea83275646f, type: 3}
--- !u!1001 &7277015660625800392 --- !u!1001 &7277015660625800392
......
...@@ -32,7 +32,12 @@ public class Briefcase : MonoBehaviour, IObject, IPlayerInteractor ...@@ -32,7 +32,12 @@ public class Briefcase : MonoBehaviour, IObject, IPlayerInteractor
dropBullet = _dropBullet; dropBullet = _dropBullet;
} }
public void Interact(Vector2Int position) private void OnDestroy()
{
PlayerController.inst.OnPlayerMove -= Interact;
}
public void Interact(Vector2Int position)
{ {
Debug.Log(Position + " " + position); Debug.Log(Position + " " + position);
if (Position == position) if (Position == position)
......
...@@ -23,6 +23,11 @@ public class CameraTurret : MonoBehaviour, IObject, IBreakable, IPlayerInteracto ...@@ -23,6 +23,11 @@ public class CameraTurret : MonoBehaviour, IObject, IBreakable, IPlayerInteracto
MapManager.inst.currentMap.clearConditions[GameManager.nTurret].IsDone(1); MapManager.inst.currentMap.clearConditions[GameManager.nTurret].IsDone(1);
Destroy(gameObject); Destroy(gameObject);
} }
private void OnDestroy()
{
PlayerController.inst.OnPlayerMove -= Interact;
}
public void Interact(Vector2Int pos) public void Interact(Vector2Int pos)
{ {
......
...@@ -50,6 +50,7 @@ public class MapEditor : SingletonBehaviour<MapEditor> ...@@ -50,6 +50,7 @@ public class MapEditor : SingletonBehaviour<MapEditor>
public Map currentMap; public Map currentMap;
public MapEditorTile tile; public MapEditorTile tile;
TileMode currentMode; TileMode currentMode;
BulletCode bulletMode;
public Text modeSign; public Text modeSign;
public GameObject startSign, goalSign, mapSizeSetter, mapEditorTiles; public GameObject startSign, goalSign, mapSizeSetter, mapEditorTiles;
public Dictionary<Floor, GameObject> startSigns, goalSigns; public Dictionary<Floor, GameObject> startSigns, goalSigns;
...@@ -150,11 +151,16 @@ public class MapEditor : SingletonBehaviour<MapEditor> ...@@ -150,11 +151,16 @@ public class MapEditor : SingletonBehaviour<MapEditor>
mapSizeSetter.SetActive(true); mapSizeSetter.SetActive(true);
isEditorStarted = false; isEditorStarted = false;
} }
public void SwitchMode(int mode) public void SwitchMode(int _tileMode)
{ {
currentMode = (TileMode)mode; currentMode = (TileMode)_tileMode;
if (currentMode != TileMode.Briefcase) SwitchBulletMode(3);
SetModeSign(); SetModeSign();
} }
public void SwitchBulletMode(int _bulletMode)
{
bulletMode = (BulletCode)_bulletMode;
}
public void SetCreateMode(bool mode) public void SetCreateMode(bool mode)
{ {
isCreateMode = mode; isCreateMode = mode;
...@@ -188,6 +194,7 @@ public class MapEditor : SingletonBehaviour<MapEditor> ...@@ -188,6 +194,7 @@ public class MapEditor : SingletonBehaviour<MapEditor>
{ {
StartMap(currentMap); StartMap(currentMap);
SwitchMode(0); SwitchMode(0);
SwitchBulletMode((int)BulletCode.None);
} }
// Update is called once per frame // Update is called once per frame
...@@ -230,9 +237,7 @@ public class MapEditor : SingletonBehaviour<MapEditor> ...@@ -230,9 +237,7 @@ public class MapEditor : SingletonBehaviour<MapEditor>
if (isCreateMode) if (isCreateMode)
{ {
if(currentMap.startFloors.Contains(currentMap.GetFloorAtPos(clickedPos))) if(currentMap.startFloors.Contains(currentMap.GetFloorAtPos(clickedPos)))
{
Debug.Log("Start floor already exists at : (" + clickedPos.x + ", " + clickedPos.y + ")"); Debug.Log("Start floor already exists at : (" + clickedPos.x + ", " + clickedPos.y + ")");
}
else else
{ {
currentMap.startFloors.Add(currentMap.GetFloorAtPos(clickedPos)); currentMap.startFloors.Add(currentMap.GetFloorAtPos(clickedPos));
...@@ -243,9 +248,7 @@ public class MapEditor : SingletonBehaviour<MapEditor> ...@@ -243,9 +248,7 @@ public class MapEditor : SingletonBehaviour<MapEditor>
else else
{ {
if (!currentMap.startFloors.Contains(currentMap.GetFloorAtPos(clickedPos))) if (!currentMap.startFloors.Contains(currentMap.GetFloorAtPos(clickedPos)))
{
Debug.Log("Start floor doesn't exist at : (" + clickedPos.x + ", " + clickedPos.y + ")"); Debug.Log("Start floor doesn't exist at : (" + clickedPos.x + ", " + clickedPos.y + ")");
}
else else
{ {
currentMap.startFloors.Remove(currentMap.GetFloorAtPos(clickedPos)); currentMap.startFloors.Remove(currentMap.GetFloorAtPos(clickedPos));
...@@ -287,6 +290,8 @@ public class MapEditor : SingletonBehaviour<MapEditor> ...@@ -287,6 +290,8 @@ public class MapEditor : SingletonBehaviour<MapEditor>
Debug.Log(wallPos); Debug.Log(wallPos);
if(currentMode == TileMode.BMannequin) if(currentMode == TileMode.BMannequin)
currentMap.CreateObject(clickedPos, ObjType.Mannequin, false); currentMap.CreateObject(clickedPos, ObjType.Mannequin, false);
else if(currentMode == TileMode.Briefcase)
currentMap.CreateObject(clickedPos, ObjType.Briefcase, bulletMode);
else else
currentMap.CreateObject(clickedPos, (ObjType)((int)currentMode - 4)); currentMap.CreateObject(clickedPos, (ObjType)((int)currentMode - 4));
} }
......
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