Commit 3a7c3ccf authored by 15박보승's avatar 15박보승

이제 서류 가방 생성자로 가지는 총알을 담음

parent 81b44dfa
{"objects":[{"tag":0,"xPos":25.0,"yPos":0.0},{"tag":2,"xPos":-1.0,"yPos":0.5},{"tag":2,"xPos":-2.0,"yPos":0.5},{"tag":3,"xPos":0.0,"yPos":0.5},{"tag":3,"xPos":1.0,"yPos":0.5},{"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":0.0},{"tag":1,"xPos":0.0,"yPos":1.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":1.0,"yPos":0.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":2.0,"yPos":-1.0},{"tag":1,"xPos":2.0,"yPos":-2.0},{"tag":1,"xPos":1.0,"yPos":-2.0},{"tag":1,"xPos":1.0,"yPos":-1.0},{"tag":1,"xPos":-1.0,"yPos":-1.0},{"tag":1,"xPos":0.0,"yPos":-2.0},{"tag":1,"xPos":0.0,"yPos":-1.0},{"tag":1,"xPos":-1.0,"yPos":-2.0},{"tag":1,"xPos":-2.0,"yPos":-1.0},{"tag":9,"xPos":-2.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":0.0},{"tag":9,"xPos":-2.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":-1.0},{"tag":7,"xPos":2.0,"yPos":-2.0},{"tag":8,"xPos":1.0,"yPos":-2.0},{"tag":5,"xPos":1.0,"yPos":0.0},{"tag":5,"xPos":0.0,"yPos":0.0},{"tag":5,"xPos":-1.0,"yPos":0.0},{"tag":5,"xPos":2.0,"yPos":0.0}],"clears":[],"cases":[1,2,3,0],"bullets":[0,1,2]}
\ No newline at end of file
fileFormatVersion: 2
guid: 61078fd8d06379c47b9709f2ed3a3290
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
......@@ -108,3 +108,4 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
floor: {fileID: 0}
dropBullet: 3
......@@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.18028334, g: 0.22571328, b: 0.3069217, a: 1}
m_IndirectSpecularColor: {r: 0.18028334, g: 0.2257134, b: 0.30692226, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
......@@ -255,6 +255,75 @@ PrefabInstance:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 06619682524bc5149b5c3092da0722f2, type: 3}
--- !u!1001 &463381731
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 52444459818764334, guid: 42247a938bb6e554eb00dc08303a72d6,
type: 3}
propertyPath: m_Name
value: GameManager
objectReference: {fileID: 0}
- target: {fileID: 52444459818764335, guid: 42247a938bb6e554eb00dc08303a72d6,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 52444459818764335, guid: 42247a938bb6e554eb00dc08303a72d6,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 52444459818764335, guid: 42247a938bb6e554eb00dc08303a72d6,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 52444459818764335, guid: 42247a938bb6e554eb00dc08303a72d6,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 52444459818764335, guid: 42247a938bb6e554eb00dc08303a72d6,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 52444459818764335, guid: 42247a938bb6e554eb00dc08303a72d6,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 52444459818764335, guid: 42247a938bb6e554eb00dc08303a72d6,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 52444459818764335, guid: 42247a938bb6e554eb00dc08303a72d6,
type: 3}
propertyPath: m_RootOrder
value: 6
objectReference: {fileID: 0}
- target: {fileID: 52444459818764335, guid: 42247a938bb6e554eb00dc08303a72d6,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 52444459818764335, guid: 42247a938bb6e554eb00dc08303a72d6,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 52444459818764335, guid: 42247a938bb6e554eb00dc08303a72d6,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 42247a938bb6e554eb00dc08303a72d6, type: 3}
--- !u!1 &797716766
GameObject:
m_ObjectHideFlags: 0
......
......@@ -1134,6 +1134,11 @@ PrefabInstance:
propertyPath: surface
value:
objectReference: {fileID: 2102809461}
- target: {fileID: 3268100033343711389, guid: 11285456de5f1854d947bea83275646f,
type: 3}
propertyPath: stage.Array.data[0]
value:
objectReference: {fileID: 4900000, guid: 61078fd8d06379c47b9709f2ed3a3290, type: 3}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 11285456de5f1854d947bea83275646f, type: 3}
--- !u!1001 &7277015660625800392
......@@ -1143,6 +1148,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
......@@ -1208,10 +1218,5 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7277015661519863741, guid: 20dee07e28273f049a9093ae4453912f,
type: 3}
propertyPath: m_NavMeshData
value:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 20dee07e28273f049a9093ae4453912f, type: 3}
......@@ -2,13 +2,6 @@
using System.Collections.Generic;
using UnityEngine;
public enum BulletCode
{
True,
False,
Mirror
}
public class BulletFactory
{
private GameObject truthBulletPrefab = null, fakeBulletPrefab = null, mirrorBulletPrefab = null;
......
......@@ -24,6 +24,14 @@ public enum WallType
Mirror
}
public enum BulletCode
{
True,
False,
Mirror,
None
}
public enum ObjType
{
NULL,
......
......@@ -6,7 +6,7 @@ public class Briefcase : MonoBehaviour, IObject, IPlayerInteractor
{
[SerializeField]
private Floor floor = null;
private BulletCode dropBullet;
public BulletCode dropBullet;
public Vector2Int Position { get { return floor != null ? floor.mapPos : throw new UnassignedReferenceException("Floor of Interactor is not assigned"); } }
public GameObject GetObject()
......@@ -35,9 +35,10 @@ public class Briefcase : MonoBehaviour, IObject, IPlayerInteractor
public void Interact(Vector2Int position)
{
Debug.Log(Position + " " + position);
PlayerController.inst.AddBullet(dropBullet);
if (Position == position)
{
{
if (dropBullet != BulletCode.None)
PlayerController.inst.AddBullet(dropBullet);
if (GameManager.aCase >= 0)
MapManager.inst.currentMap.clearConditions[GameManager.aCase].IsDone(1);
if (GameManager.nCase >= 0)
......
......@@ -34,6 +34,7 @@ public class MapManager : SingletonBehaviour<MapManager>
currentMap = Instantiate(currentMap, new Vector3(0, 0, 0), Quaternion.identity);
currentMap.InitiateMap();
currentMap.maxMapSize = (int)loadedMapData.objects[0].xPos;
int casesIndex = 0;
for(int i = 1; i < loadedMapData.objects.Count; i++)
{
var temp = loadedMapData.objects[i];
......@@ -52,7 +53,7 @@ public class MapManager : SingletonBehaviour<MapManager>
currentMap.startFloors.Add(currentMap.GetFloorAtPos(new Vector2Int((int)temp.xPos, (int)temp.yPos)));
break;
case TileMode.Briefcase:
currentMap.CreateObject(new Vector2Int((int)temp.xPos, (int)temp.yPos), ObjType.Briefcase);
currentMap.CreateObject(new Vector2Int((int)temp.xPos, (int)temp.yPos), ObjType.Briefcase, loadedMapData.cases[casesIndex++]);
break;
case TileMode.Camera:
currentMap.CreateObject(new Vector2Int((int)temp.xPos, (int)temp.yPos), ObjType.Camera);
......
......@@ -242,6 +242,11 @@ public class Map : MonoBehaviour
else
Debug.Log("Object already exists at : (" + pos.x + ", " + pos.y + ")");
}
public void CreateObject(Vector2Int pos, ObjType objType, BulletCode _dropBullet)
{
CreateObject(pos, objType);
GetObjectAtPos(pos).GetObject().GetComponent<Briefcase>().dropBullet = _dropBullet;
}
/// <summary>
/// Remove Object at position.
/// </summary>
......
......@@ -29,11 +29,13 @@ public class MapEditor : SingletonBehaviour<MapEditor>
{
public List<objectData> objects;
public List<clearData> clears;
public List<BulletCode> cases;
public List<BulletCode> bullets;
public MapSaveData()
{
objects = new List<objectData>();
clears = new List<clearData>();
cases = new List<BulletCode>();
bullets = new List<BulletCode>();
}
public void AddObject(TileMode _tag, Vector2 _pos)
......@@ -101,7 +103,10 @@ public class MapEditor : SingletonBehaviour<MapEditor>
{
IObject temp = child.GetComponent<IObject>();
if (temp.GetType() == ObjType.Briefcase)
{
mapSaveData.cases.Add(temp.GetObject().GetComponent<Briefcase>().dropBullet);
mapSaveData.AddObject(TileMode.Briefcase, temp.GetPos());
}
else if(temp.GetType() == ObjType.Camera)
mapSaveData.AddObject(TileMode.Camera, temp.GetPos());
else if (temp.GetType() == ObjType.Mannequin)
......
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