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