Commit c95e51c0 authored by 18손재민's avatar 18손재민

Merge branch 'map'

parents 125f9cfe 755664ce
...@@ -106,7 +106,6 @@ MonoBehaviour: ...@@ -106,7 +106,6 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
mapPos: {x: 1, y: 0} mapPos: {x: 1, y: 0}
isPassed: 0
isGoalFloor: 0 isGoalFloor: 0
--- !u!1 &1634709099193762938 --- !u!1 &1634709099193762938
GameObject: GameObject:
...@@ -214,7 +213,6 @@ MonoBehaviour: ...@@ -214,7 +213,6 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
mapPos: {x: -2, y: -1} mapPos: {x: -2, y: -1}
isPassed: 0
isGoalFloor: 0 isGoalFloor: 0
--- !u!1 &1638206002697659172 --- !u!1 &1638206002697659172
GameObject: GameObject:
...@@ -322,7 +320,6 @@ MonoBehaviour: ...@@ -322,7 +320,6 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
mapPos: {x: 1, y: 1} mapPos: {x: 1, y: 1}
isPassed: 0
isGoalFloor: 0 isGoalFloor: 0
--- !u!1 &1737410653383664023 --- !u!1 &1737410653383664023
GameObject: GameObject:
...@@ -378,6 +375,7 @@ MonoBehaviour: ...@@ -378,6 +375,7 @@ MonoBehaviour:
- {fileID: 6317210441967747213} - {fileID: 6317210441967747213}
- {fileID: 8692496119037193698} - {fileID: 8692496119037193698}
- {fileID: 4002211523417806573} - {fileID: 4002211523417806573}
initialBullets: 00000000010000000200000000000000010000000200000000000000010000000200000000000000
clearConditions: clearConditions:
- type: 0 - type: 0
count: 0 count: 0
...@@ -491,7 +489,6 @@ MonoBehaviour: ...@@ -491,7 +489,6 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
mapPos: {x: 2, y: 0} mapPos: {x: 2, y: 0}
isPassed: 0
isGoalFloor: 0 isGoalFloor: 0
--- !u!1 &2189700681577347922 --- !u!1 &2189700681577347922
GameObject: GameObject:
...@@ -599,7 +596,6 @@ MonoBehaviour: ...@@ -599,7 +596,6 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
mapPos: {x: -2, y: 2} mapPos: {x: -2, y: 2}
isPassed: 0
isGoalFloor: 0 isGoalFloor: 0
--- !u!1 &2292282653549884484 --- !u!1 &2292282653549884484
GameObject: GameObject:
...@@ -707,7 +703,6 @@ MonoBehaviour: ...@@ -707,7 +703,6 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
mapPos: {x: -1, y: 2} mapPos: {x: -1, y: 2}
isPassed: 0
isGoalFloor: 0 isGoalFloor: 0
--- !u!1 &2339437859421285817 --- !u!1 &2339437859421285817
GameObject: GameObject:
...@@ -815,7 +810,6 @@ MonoBehaviour: ...@@ -815,7 +810,6 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
mapPos: {x: -2, y: -2} mapPos: {x: -2, y: -2}
isPassed: 0
isGoalFloor: 0 isGoalFloor: 0
--- !u!1 &2681926362236754680 --- !u!1 &2681926362236754680
GameObject: GameObject:
...@@ -923,7 +917,6 @@ MonoBehaviour: ...@@ -923,7 +917,6 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
mapPos: {x: 2, y: 1} mapPos: {x: 2, y: 1}
isPassed: 0
isGoalFloor: 0 isGoalFloor: 0
--- !u!1 &3525591482656589422 --- !u!1 &3525591482656589422
GameObject: GameObject:
...@@ -1031,7 +1024,6 @@ MonoBehaviour: ...@@ -1031,7 +1024,6 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
mapPos: {x: 2, y: -2} mapPos: {x: 2, y: -2}
isPassed: 0
isGoalFloor: 0 isGoalFloor: 0
--- !u!1 &4007647678807291638 --- !u!1 &4007647678807291638
GameObject: GameObject:
...@@ -1264,7 +1256,6 @@ MonoBehaviour: ...@@ -1264,7 +1256,6 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
mapPos: {x: 1, y: -2} mapPos: {x: 1, y: -2}
isPassed: 0
isGoalFloor: 0 isGoalFloor: 0
--- !u!1 &4592160369612705167 --- !u!1 &4592160369612705167
GameObject: GameObject:
...@@ -1372,7 +1363,6 @@ MonoBehaviour: ...@@ -1372,7 +1363,6 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
mapPos: {x: 1, y: -1} mapPos: {x: 1, y: -1}
isPassed: 0
isGoalFloor: 0 isGoalFloor: 0
--- !u!1 &4709249395185914413 --- !u!1 &4709249395185914413
GameObject: GameObject:
...@@ -1480,7 +1470,6 @@ MonoBehaviour: ...@@ -1480,7 +1470,6 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
mapPos: {x: 1, y: 2} mapPos: {x: 1, y: 2}
isPassed: 0
isGoalFloor: 0 isGoalFloor: 0
--- !u!1 &4810397660174508062 --- !u!1 &4810397660174508062
GameObject: GameObject:
...@@ -1588,7 +1577,6 @@ MonoBehaviour: ...@@ -1588,7 +1577,6 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
mapPos: {x: -1, y: -1} mapPos: {x: -1, y: -1}
isPassed: 0
isGoalFloor: 0 isGoalFloor: 0
--- !u!1 &5069305046428251933 --- !u!1 &5069305046428251933
GameObject: GameObject:
...@@ -1696,7 +1684,6 @@ MonoBehaviour: ...@@ -1696,7 +1684,6 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
mapPos: {x: -1, y: 0} mapPos: {x: -1, y: 0}
isPassed: 0
isGoalFloor: 0 isGoalFloor: 0
--- !u!1 &5342110572568681991 --- !u!1 &5342110572568681991
GameObject: GameObject:
...@@ -1804,7 +1791,6 @@ MonoBehaviour: ...@@ -1804,7 +1791,6 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
mapPos: {x: 0, y: -2} mapPos: {x: 0, y: -2}
isPassed: 0
isGoalFloor: 0 isGoalFloor: 0
--- !u!1 &5390496715387352304 --- !u!1 &5390496715387352304
GameObject: GameObject:
...@@ -2092,7 +2078,6 @@ MonoBehaviour: ...@@ -2092,7 +2078,6 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
mapPos: {x: 0, y: 1} mapPos: {x: 0, y: 1}
isPassed: 0
isGoalFloor: 0 isGoalFloor: 0
--- !u!1 &6532917746544365902 --- !u!1 &6532917746544365902
GameObject: GameObject:
...@@ -2234,7 +2219,6 @@ MonoBehaviour: ...@@ -2234,7 +2219,6 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
mapPos: {x: -2, y: 1} mapPos: {x: -2, y: 1}
isPassed: 0
isGoalFloor: 0 isGoalFloor: 0
--- !u!1 &7141810549857698684 --- !u!1 &7141810549857698684
GameObject: GameObject:
...@@ -2342,7 +2326,6 @@ MonoBehaviour: ...@@ -2342,7 +2326,6 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
mapPos: {x: 0, y: 0} mapPos: {x: 0, y: 0}
isPassed: 0
isGoalFloor: 0 isGoalFloor: 0
--- !u!1 &7422189717627061705 --- !u!1 &7422189717627061705
GameObject: GameObject:
...@@ -2575,7 +2558,6 @@ MonoBehaviour: ...@@ -2575,7 +2558,6 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
mapPos: {x: -2, y: 0} mapPos: {x: -2, y: 0}
isPassed: 0
isGoalFloor: 0 isGoalFloor: 0
--- !u!1 &7560450311381198066 --- !u!1 &7560450311381198066
GameObject: GameObject:
...@@ -2838,7 +2820,6 @@ MonoBehaviour: ...@@ -2838,7 +2820,6 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
mapPos: {x: -1, y: 1} mapPos: {x: -1, y: 1}
isPassed: 0
isGoalFloor: 0 isGoalFloor: 0
--- !u!1 &8683807963293059402 --- !u!1 &8683807963293059402
GameObject: GameObject:
...@@ -2946,7 +2927,6 @@ MonoBehaviour: ...@@ -2946,7 +2927,6 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
mapPos: {x: 0, y: 2} mapPos: {x: 0, y: 2}
isPassed: 0
isGoalFloor: 0 isGoalFloor: 0
--- !u!1 &8695425579486219508 --- !u!1 &8695425579486219508
GameObject: GameObject:
...@@ -3054,7 +3034,6 @@ MonoBehaviour: ...@@ -3054,7 +3034,6 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
mapPos: {x: 2, y: 2} mapPos: {x: 2, y: 2}
isPassed: 0
isGoalFloor: 0 isGoalFloor: 0
--- !u!1 &8852115476851130467 --- !u!1 &8852115476851130467
GameObject: GameObject:
...@@ -3162,7 +3141,6 @@ MonoBehaviour: ...@@ -3162,7 +3141,6 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
mapPos: {x: 0, y: -1} mapPos: {x: 0, y: -1}
isPassed: 0
isGoalFloor: 0 isGoalFloor: 0
--- !u!1 &9046791506793280589 --- !u!1 &9046791506793280589
GameObject: GameObject:
...@@ -3270,7 +3248,6 @@ MonoBehaviour: ...@@ -3270,7 +3248,6 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
mapPos: {x: -1, y: -2} mapPos: {x: -1, y: -2}
isPassed: 0
isGoalFloor: 0 isGoalFloor: 0
--- !u!1 &9206324191454810788 --- !u!1 &9206324191454810788
GameObject: GameObject:
...@@ -3378,5 +3355,4 @@ MonoBehaviour: ...@@ -3378,5 +3355,4 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
mapPos: {x: 2, y: -1} mapPos: {x: 2, y: -1}
isPassed: 0
isGoalFloor: 0 isGoalFloor: 0
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &646008409675212278
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5027787848459216200}
- component: {fileID: 841522919254151368}
m_Layer: 0
m_Name: Goal Sign
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &5027787848459216200
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 646008409675212278}
m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068}
m_LocalPosition: {x: 0, y: 0, z: 2}
m_LocalScale: {x: 2, y: 2, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
--- !u!212 &841522919254151368
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 646008409675212278}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: b489da500f22d7a4b8c478cae46976ad, type: 3}
m_Color: {r: 1, g: 0.99501103, b: 0, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 0.16, y: 0.16}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
fileFormatVersion: 2 fileFormatVersion: 2
guid: 32ff564f49869bf40a53d07394eb081b guid: 6801da87b9c13dc4a97e2c31d6e37ab3
PrefabImporter: PrefabImporter:
externalObjects: {} externalObjects: {}
userData: userData:
......
This diff is collapsed.
...@@ -38,7 +38,7 @@ RenderSettings: ...@@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity: 1 m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0} m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0} m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.18028334, g: 0.2257134, b: 0.30692226, a: 1} m_IndirectSpecularColor: {r: 0.18028334, g: 0.22571328, b: 0.3069217, a: 1}
m_UseRadianceAmbientProbe: 0 m_UseRadianceAmbientProbe: 0
--- !u!157 &3 --- !u!157 &3
LightmapSettings: LightmapSettings:
...@@ -341,7 +341,7 @@ Transform: ...@@ -341,7 +341,7 @@ Transform:
m_GameObject: {fileID: 797716766} m_GameObject: {fileID: 797716766}
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
m_LocalPosition: {x: 0, y: 3, z: 0} m_LocalPosition: {x: 0, y: 3, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 0.99999994}
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 2 m_RootOrder: 2
...@@ -501,6 +501,75 @@ PrefabInstance: ...@@ -501,6 +501,75 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 20dee07e28273f049a9093ae4453912f, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 20dee07e28273f049a9093ae4453912f, type: 3}
--- !u!1001 &1133429038
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 &1295796961 --- !u!1 &1295796961
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
......
...@@ -40,5 +40,18 @@ public class GameManager : SingletonBehaviour<GameManager> ...@@ -40,5 +40,18 @@ public class GameManager : SingletonBehaviour<GameManager>
{ {
if (!MapManager.inst.isMapEditingOn) if (!MapManager.inst.isMapEditingOn)
MapManager.inst.LoadMap(MapManager.inst.stage[0]); MapManager.inst.LoadMap(MapManager.inst.stage[0]);
else
{
for (int i = 0; i < 9; i++) clearIndex[i] = -1;
nFloor = clearIndex[(int)ClearType.NFloor];
nTurret = clearIndex[(int)ClearType.NTurret];
nCase = clearIndex[(int)ClearType.NCase];
nPlayer = clearIndex[(int)ClearType.NPlayer];
aFloor = clearIndex[(int)ClearType.AllFloor];
aTurret = clearIndex[(int)ClearType.AllTurret];
aCase = clearIndex[(int)ClearType.AllCase];
white = clearIndex[(int)ClearType.White];
black = clearIndex[(int)ClearType.Black];
}
} }
} }
...@@ -25,7 +25,7 @@ public class MapManager : SingletonBehaviour<MapManager> ...@@ -25,7 +25,7 @@ public class MapManager : SingletonBehaviour<MapManager>
public void LoadMap(Map _newMap) public void LoadMap(Map _newMap)
{ {
if(currentMap != null) if (currentMap != null)
Destroy(currentMap.gameObject); Destroy(currentMap.gameObject);
currentMap = Instantiate(_newMap); currentMap = Instantiate(_newMap);
currentMap.transform.position = new Vector3(0, 0, 0); currentMap.transform.position = new Vector3(0, 0, 0);
...@@ -33,6 +33,8 @@ public class MapManager : SingletonBehaviour<MapManager> ...@@ -33,6 +33,8 @@ public class MapManager : SingletonBehaviour<MapManager>
GameManager.inst.SetClearIndex(currentMap); GameManager.inst.SetClearIndex(currentMap);
for (int i = 0; i < currentMap.startFloors.Count; i++) for (int i = 0; i < currentMap.startFloors.Count; i++)
PlayerController.inst.CreatePlayer(currentMap.startFloors[i]); PlayerController.inst.CreatePlayer(currentMap.startFloors[i]);
for (int i = 0; i < currentMap.initialBullets.Count; i++)
PlayerController.inst.bulletList.Add(currentMap.initialBullets[i]);
} }
public IEnumerator Rebaker() public IEnumerator Rebaker()
{ {
......
...@@ -31,6 +31,8 @@ public class ClearCondition ...@@ -31,6 +31,8 @@ public class ClearCondition
}*/ }*/
public void IsDone(int _count = 0, int _goal = 0) public void IsDone(int _count = 0, int _goal = 0)
{
if (!MapManager.inst.isMapEditingOn)
{ {
count += _count; count += _count;
goal += _goal; goal += _goal;
...@@ -48,4 +50,5 @@ public class ClearCondition ...@@ -48,4 +50,5 @@ public class ClearCondition
isDone = false; isDone = false;
} }
} }
}
} }
...@@ -14,6 +14,7 @@ public class Map : MonoBehaviour ...@@ -14,6 +14,7 @@ public class Map : MonoBehaviour
public GameObject walls; public GameObject walls;
public GameObject objects; public GameObject objects;
public List<Floor> startFloors; public List<Floor> startFloors;
public List<BulletCode> initialBullets;
public List<ClearCondition> clearConditions; public List<ClearCondition> clearConditions;
...@@ -61,7 +62,7 @@ public class Map : MonoBehaviour ...@@ -61,7 +62,7 @@ public class Map : MonoBehaviour
floorGrid[pos].mapPos = pos; floorGrid[pos].mapPos = pos;
floorGrid[pos].isGoalFloor = isGoal; floorGrid[pos].isGoalFloor = isGoal;
if (GameManager.aFloor >= 0 && isGoal) if (GameManager.aFloor >= 0 && isGoal)
MapManager.inst.currentMap.clearConditions[GameManager.aFloor].IsDone(0, 1); clearConditions[GameManager.aFloor].IsDone(0, 1);
StartCoroutine(MapManager.inst.Rebaker()); StartCoroutine(MapManager.inst.Rebaker());
} }
else else
...@@ -96,7 +97,7 @@ public class Map : MonoBehaviour ...@@ -96,7 +97,7 @@ public class Map : MonoBehaviour
if (floorGrid.ContainsKey(pos)) if (floorGrid.ContainsKey(pos))
{ {
if (GameManager.aFloor >= 0 && floorGrid[pos].isGoalFloor) if (GameManager.aFloor >= 0 && floorGrid[pos].isGoalFloor)
MapManager.inst.currentMap.clearConditions[GameManager.aFloor].IsDone(0, -1); clearConditions[GameManager.aFloor].IsDone(0, -1);
Destroy(floorGrid[pos].gameObject); Destroy(floorGrid[pos].gameObject);
floorGrid.Remove(pos); floorGrid.Remove(pos);
StartCoroutine(MapManager.inst.Rebaker()); StartCoroutine(MapManager.inst.Rebaker());
...@@ -219,12 +220,12 @@ public class Map : MonoBehaviour ...@@ -219,12 +220,12 @@ public class Map : MonoBehaviour
case ObjType.Briefcase: case ObjType.Briefcase:
objectGrid.Add(pos, Instantiate(MapManager.inst.briefCase, new Vector3(pos.x, 0, pos.y), Quaternion.identity, objects.transform).GetComponent<IObject>()); objectGrid.Add(pos, Instantiate(MapManager.inst.briefCase, new Vector3(pos.x, 0, pos.y), Quaternion.identity, objects.transform).GetComponent<IObject>());
if (GameManager.aCase >= 0) if (GameManager.aCase >= 0)
MapManager.inst.currentMap.clearConditions[GameManager.aCase].IsDone(0, 1); clearConditions[GameManager.aCase].IsDone(0, 1);
break; break;
case ObjType.Camera: case ObjType.Camera:
objectGrid.Add(pos, Instantiate(MapManager.inst.cameraTurret, new Vector3(pos.x, 0, pos.y), Quaternion.identity, objects.transform).GetComponent<IObject>()); objectGrid.Add(pos, Instantiate(MapManager.inst.cameraTurret, new Vector3(pos.x, 0, pos.y), Quaternion.identity, objects.transform).GetComponent<IObject>());
if (GameManager.aTurret >= 0) if (GameManager.aTurret >= 0)
MapManager.inst.currentMap.clearConditions[GameManager.aTurret].IsDone(0, 1); clearConditions[GameManager.aTurret].IsDone(0, 1);
break; break;
case ObjType.Mannequin: case ObjType.Mannequin:
objectGrid.Add(pos, Instantiate(MapManager.inst.mannequins[Random.Range(0, 5)], new Vector3(pos.x, 0, pos.y), Quaternion.identity, objects.transform).GetComponent<IObject>()); objectGrid.Add(pos, Instantiate(MapManager.inst.mannequins[Random.Range(0, 5)], new Vector3(pos.x, 0, pos.y), Quaternion.identity, objects.transform).GetComponent<IObject>());
...@@ -246,15 +247,15 @@ public class Map : MonoBehaviour ...@@ -246,15 +247,15 @@ public class Map : MonoBehaviour
if (objectGrid.ContainsKey(pos)) if (objectGrid.ContainsKey(pos))
{ {
if(objectGrid[pos].GetType() == ObjType.Briefcase && GameManager.aCase >= 0) if(objectGrid[pos].GetType() == ObjType.Briefcase && GameManager.aCase >= 0)
MapManager.inst.currentMap.clearConditions[GameManager.aCase].IsDone(0, -1); clearConditions[GameManager.aCase].IsDone(0, -1);
else if (objectGrid[pos].GetType() == ObjType.Camera && GameManager.aTurret >= 0) else if (objectGrid[pos].GetType() == ObjType.Camera && GameManager.aTurret >= 0)
MapManager.inst.currentMap.clearConditions[GameManager.aTurret].IsDone(0, -1); clearConditions[GameManager.aTurret].IsDone(0, -1);
else if(objectGrid[pos].GetType() == ObjType.Mannequin) else if(objectGrid[pos].GetType() == ObjType.Mannequin)
{ {
if(objectGrid[pos].GetObject().GetComponent<Mannequin>().isWhite && GameManager.white >= 0) if(objectGrid[pos].GetObject().GetComponent<Mannequin>().isWhite && GameManager.white >= 0)
MapManager.inst.currentMap.clearConditions[GameManager.white].IsDone(0, -1); clearConditions[GameManager.white].IsDone(0, -1);
else if (!objectGrid[pos].GetObject().GetComponent<Mannequin>().isWhite && GameManager.black >= 0) else if (!objectGrid[pos].GetObject().GetComponent<Mannequin>().isWhite && GameManager.black >= 0)
MapManager.inst.currentMap.clearConditions[GameManager.black].IsDone(0, -1); clearConditions[GameManager.black].IsDone(0, -1);
} }
Destroy(objectGrid[pos].GetObject()); Destroy(objectGrid[pos].GetObject());
objectGrid.Remove(pos); objectGrid.Remove(pos);
......
...@@ -9,16 +9,13 @@ public class MapEditor : SingletonBehaviour<MapEditor> ...@@ -9,16 +9,13 @@ public class MapEditor : SingletonBehaviour<MapEditor>
public Map currentMap; public Map currentMap;
public Map[] stage; public Map[] stage;
public MapEditorTile tile; public MapEditorTile tile;
public enum TileMode { None, Floor, NormalWall, Mirror, StartFloor, Briefcase, Camera, WMannequin, BMannequin }; public enum TileMode { None, Floor, Normal, Mirror, StartFloor, Briefcase, Camera, WMannequin, BMannequin, goalFloor };
TileMode currentMode; TileMode currentMode;
public Text modeSign; public Text modeSign;
public GameObject startSign; public GameObject startSign, goalSign, mapSizeSetter, mapEditorTiles;
public Dictionary<Floor, GameObject> startSigns; public Dictionary<Floor, GameObject> startSigns, goalSigns;
public GameObject mapSizeSetter;
public GameObject mapEditorTiles;
public Material editWallMat; public Material editNormalMat, realNormalMat;
public Material realWallMat;
bool isEditorStarted; bool isEditorStarted;
bool isCreateMode; bool isCreateMode;
...@@ -45,16 +42,14 @@ public class MapEditor : SingletonBehaviour<MapEditor> ...@@ -45,16 +42,14 @@ public class MapEditor : SingletonBehaviour<MapEditor>
Debug.Log("There is no start floor."); Debug.Log("There is no start floor.");
else else
{ {
foreach(Transform child in currentMap.walls.transform) foreach (Transform child in currentMap.walls.transform)
{ if (child.GetComponent<Wall>() is NormalWall)
child.gameObject.GetComponent<MeshRenderer>().material = realWallMat; child.gameObject.GetComponent<MeshRenderer>().material = realNormalMat;
}
PrefabUtility.SaveAsPrefabAsset(_newMap.gameObject, localPath); PrefabUtility.SaveAsPrefabAsset(_newMap.gameObject, localPath);
Debug.Log("Map saved at " + localPath); Debug.Log("Map saved at " + localPath);
foreach (Transform child in currentMap.walls.transform) foreach (Transform child in currentMap.walls.transform)
{ if (child.GetComponent<Wall>() is NormalWall)
child.gameObject.GetComponent<MeshRenderer>().material = editWallMat; child.gameObject.GetComponent<MeshRenderer>().material = editNormalMat;
}
} }
} }
public void SaveCurrentMap() public void SaveCurrentMap()
...@@ -101,6 +96,11 @@ public class MapEditor : SingletonBehaviour<MapEditor> ...@@ -101,6 +96,11 @@ public class MapEditor : SingletonBehaviour<MapEditor>
else else
modeSign.text = sign + " Destroy"; modeSign.text = sign + " Destroy";
} }
public void AddBulletToPlayer(int bulletMode)
{
currentMap.initialBullets.Add((BulletCode)bulletMode);
//PlayerController.inst.bulletList.Add((BulletCode)bulletMode);
}
private void Awake() private void Awake()
{ {
...@@ -108,6 +108,7 @@ public class MapEditor : SingletonBehaviour<MapEditor> ...@@ -108,6 +108,7 @@ public class MapEditor : SingletonBehaviour<MapEditor>
isEditorStarted = false; isEditorStarted = false;
isCreateMode = true; isCreateMode = true;
startSigns = new Dictionary<Floor, GameObject>(); startSigns = new Dictionary<Floor, GameObject>();
goalSigns = new Dictionary<Floor, GameObject>();
} }
// Start is called before the first frame update // Start is called before the first frame update
...@@ -140,26 +141,14 @@ public class MapEditor : SingletonBehaviour<MapEditor> ...@@ -140,26 +141,14 @@ public class MapEditor : SingletonBehaviour<MapEditor>
else else
currentMap.RemoveFloor(clickedPos); currentMap.RemoveFloor(clickedPos);
} }
else if(currentMode == TileMode.NormalWall) else if(currentMode == TileMode.Normal || currentMode == TileMode.Mirror)
{
if (isCreateMode)
{
Debug.Log(wallPos);
currentMap.CreateWall(wallPos, WallType.Normal);
if(currentMap.GetWallAtPos(wallPos) != null)
currentMap.GetWallAtPos(wallPos).gameObject.GetComponent<MeshRenderer>().material = editWallMat;
}
else
currentMap.RemoveWall(wallPos);
}
else if (currentMode == TileMode.Mirror)
{ {
if (isCreateMode) if (isCreateMode)
{ {
Debug.Log(wallPos); Debug.Log(wallPos);
currentMap.CreateWall(wallPos, WallType.Mirror); currentMap.CreateWall(wallPos, (WallType)((int)currentMode - 1));
if (currentMap.GetWallAtPos(wallPos) != null) if (currentMap.GetWallAtPos(wallPos) != null && currentMap.GetWallAtPos(wallPos).GetComponent<Wall>() is NormalWall)
currentMap.GetWallAtPos(wallPos).gameObject.GetComponent<MeshRenderer>().material = editWallMat; currentMap.GetWallAtPos(wallPos).gameObject.GetComponent<MeshRenderer>().material = editNormalMat;
} }
else else
currentMap.RemoveWall(wallPos); currentMap.RemoveWall(wallPos);
...@@ -193,7 +182,33 @@ public class MapEditor : SingletonBehaviour<MapEditor> ...@@ -193,7 +182,33 @@ public class MapEditor : SingletonBehaviour<MapEditor>
} }
} }
} }
else if((int)currentMode >= 5) else if(currentMode == TileMode.goalFloor)
{
if (isCreateMode)
{
if (currentMap.GetFloorAtPos(clickedPos).isGoalFloor)
Debug.Log("Goal floor already exists at : (" + clickedPos.x + ", " + clickedPos.y + ")");
else
{
currentMap.GetFloorAtPos(clickedPos).isGoalFloor = true;
goalSigns.Add(currentMap.GetFloorAtPos(clickedPos),
Instantiate(goalSign));
goalSigns[currentMap.GetFloorAtPos(clickedPos)].transform.position = new Vector3(clickedPos.x, 2, clickedPos.y);
}
}
else
{
if (!currentMap.GetFloorAtPos(clickedPos).isGoalFloor)
Debug.Log("Goal floor doesn't exist at : (" + clickedPos.x + ", " + clickedPos.y + ")");
else
{
currentMap.GetFloorAtPos(clickedPos).isGoalFloor = false;
Destroy(goalSigns[currentMap.GetFloorAtPos(clickedPos)].gameObject);
goalSigns.Remove(currentMap.GetFloorAtPos(clickedPos));
}
}
}
else if((int)currentMode >= 5 && (int)currentMode <= 8)
{ {
if (isCreateMode) if (isCreateMode)
{ {
......
...@@ -8,7 +8,7 @@ public class PlayerController : SingletonBehaviour<PlayerController> ...@@ -8,7 +8,7 @@ public class PlayerController : SingletonBehaviour<PlayerController>
{ {
public Player currentPlayer; public Player currentPlayer;
public bool isPlayerMoving, isPlayerShooting, isZooming; public bool isPlayerMoving, isPlayerShooting, isZooming;
private List<BulletCode> bulletList = new List<BulletCode>(); public List<BulletCode> bulletList = new List<BulletCode>();
private int bulletCount = 0; private int bulletCount = 0;
private Vector2Int prePos; private Vector2Int prePos;
public Vector2Int MapPos public Vector2Int MapPos
...@@ -126,16 +126,6 @@ public class PlayerController : SingletonBehaviour<PlayerController> ...@@ -126,16 +126,6 @@ public class PlayerController : SingletonBehaviour<PlayerController>
void Start() void Start()
{ {
prePos = MapPos; prePos = MapPos;
bulletList.Add(BulletCode.Mirror);
bulletList.Add(BulletCode.False);
bulletList.Add(BulletCode.Mirror);
bulletList.Add(BulletCode.False);
bulletList.Add(BulletCode.Mirror);
bulletList.Add(BulletCode.False);
bulletList.Add(BulletCode.Mirror);
bulletList.Add(BulletCode.False);
bulletList.Add(BulletCode.Mirror);
bulletList.Add(BulletCode.False);
} }
// Update is called once per frame // Update is called once per frame
......
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