Commit 4bfc9450 authored by 18신대성's avatar 18신대성

골지점 복사 수정, 또 거울 수-정

parent 90a0a3ed
...@@ -61,7 +61,7 @@ Material: ...@@ -61,7 +61,7 @@ Material:
- _DetailNormalMapScale: 1 - _DetailNormalMapScale: 1
- _DstBlend: 0 - _DstBlend: 0
- _GlossMapScale: 1 - _GlossMapScale: 1
- _Glossiness: 0.5 - _Glossiness: 0
- _GlossyReflections: 1 - _GlossyReflections: 1
- _Metallic: 0 - _Metallic: 0
- _Mode: 0 - _Mode: 0
...@@ -73,5 +73,5 @@ Material: ...@@ -73,5 +73,5 @@ Material:
- _UVSec: 0 - _UVSec: 0
- _ZWrite: 1 - _ZWrite: 1
m_Colors: m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1} - _Color: {r: 0.5707547, g: 0.57195157, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
{"objects":[{"tag":0,"xPos":25.0,"yPos":0.0},{"tag":2,"xPos":-2.0,"yPos":-0.5},{"tag":3,"xPos":1.5,"yPos":0.0},{"tag":2,"xPos":1.0,"yPos":-0.5},{"tag":2,"xPos":2.0,"yPos":-0.5},{"tag":3,"xPos":-1.5,"yPos":0.0},{"tag":1,"xPos":-2.0,"yPos":0.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":2.0,"yPos":-1.0},{"tag":1,"xPos":1.0,"yPos":-1.0},{"tag":4,"xPos":0.0,"yPos":-1.0},{"tag":5,"xPos":-2.0,"yPos":0.0},{"tag":5,"xPos":2.0,"yPos":0.0}],"clears":[{"type":6,"goal":2}],"cases":[0,1],"bullets":[1,1,1,1],"comments":null}
\ No newline at end of file
fileFormatVersion: 2
guid: 34d47bb45c63f2c409aba21d51a5946e
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
...@@ -1364,6 +1364,10 @@ PrefabInstance: ...@@ -1364,6 +1364,10 @@ PrefabInstance:
propertyPath: commentUIGenerator propertyPath: commentUIGenerator
value: value:
objectReference: {fileID: 158856774} objectReference: {fileID: 158856774}
- target: {fileID: 2122327709, guid: 42247a938bb6e554eb00dc08303a72d6, type: 3}
propertyPath: currentStage
value:
objectReference: {fileID: 0}
- target: {fileID: 52444459818764334, guid: 42247a938bb6e554eb00dc08303a72d6, - target: {fileID: 52444459818764334, guid: 42247a938bb6e554eb00dc08303a72d6,
type: 3} type: 3}
propertyPath: m_Name propertyPath: m_Name
......
...@@ -78,7 +78,11 @@ public class Map : MonoBehaviour ...@@ -78,7 +78,11 @@ public class Map : MonoBehaviour
StartCoroutine(MapManager.inst.Rebaker()); StartCoroutine(MapManager.inst.Rebaker());
} }
else else
{
Debug.Log("Floor already exists at : (" + pos.x + ", " + pos.y + ")"); Debug.Log("Floor already exists at : (" + pos.x + ", " + pos.y + ")");
floorGrid[pos].isGoalFloor = isGoal;
floorGrid[pos].RefreshGoal();
}
} }
/// <summary> /// <summary>
/// Create floor in rectangular area between pos1 and pos2. /// Create floor in rectangular area between pos1 and pos2.
......
...@@ -95,12 +95,6 @@ public class Mirror : Wall, IBulletInteractor, IBreakable ...@@ -95,12 +95,6 @@ public class Mirror : Wall, IBulletInteractor, IBreakable
Vector2 oppWallPos = new Vector2(nextx, nexty); Vector2 oppWallPos = new Vector2(nextx, nexty);
Wall wallAtPos = MapManager.inst.currentMap.GetWallAtPos(wallPos); Wall wallAtPos = MapManager.inst.currentMap.GetWallAtPos(wallPos);
if (wallAtPos != null) // have wall at wallpos if (wallAtPos != null) // have wall at wallpos
{
if (MapManager.inst.currentMap.wallGrid.ContainsKey(oppWallPos) && wallAtPos.type == WallType.Mirror) // change to Mirror
{
MapManager.inst.currentMap.ChangeToMirror(oppWallPos);
}
else // create wall
{ {
Pair wallPair = new Pair(PointToParRay(stPos, wallAtPos.ldPos, true), PointToParRay(stPos, wallAtPos.rdPos, true)); Pair wallPair = new Pair(PointToParRay(stPos, wallAtPos.ldPos, true), PointToParRay(stPos, wallAtPos.rdPos, true));
if (wallPair.l > wallPair.r) wallPair = wallPair.Swap(); if (wallPair.l > wallPair.r) wallPair = wallPair.Swap();
...@@ -109,13 +103,17 @@ public class Mirror : Wall, IBulletInteractor, IBreakable ...@@ -109,13 +103,17 @@ public class Mirror : Wall, IBulletInteractor, IBreakable
{ {
MapManager.inst.currentMap.CreateWall(oppWallPos, wallAtPos.type); MapManager.inst.currentMap.CreateWall(oppWallPos, wallAtPos.type);
SubtractRay(parRay, wallPair); SubtractRay(parRay, wallPair);
if (wallAtPos.type == WallType.Mirror) // change to Mirror
{
MapManager.inst.currentMap.ChangeToMirror(oppWallPos);
} }
} }
} }
else if (MapManager.inst.currentMap.GetWallAtPos(oppWallPos) != null) // no wall at wallPos but have at opposite else if (MapManager.inst.currentMap.GetWallAtPos(oppWallPos) != null) // no wall at wallPos but have at opposite
{ {
// remove wall Pair tempPair = new Pair(PointToParRay(stPos, wallPos + (dir ? new Vector2(-0.5f, 0) : new Vector2(0, -0.5f)), true), PointToParRay(stPos, wallPos + (dir ? new Vector2(0.5f, 0) : new Vector2(0, 0.5f)), true));
MapManager.inst.currentMap.RemoveWall(oppWallPos); if (IsInRay(parRay, tempPair)) MapManager.inst.currentMap.RemoveWall(oppWallPos);
} }
} }
float iMid = i + 0.5f * side; float iMid = i + 0.5f * side;
...@@ -129,12 +127,6 @@ public class Mirror : Wall, IBulletInteractor, IBreakable ...@@ -129,12 +127,6 @@ public class Mirror : Wall, IBulletInteractor, IBreakable
Vector2 oppWallPos = new Vector2(nextx, nexty); Vector2 oppWallPos = new Vector2(nextx, nexty);
Wall wallAtPos = MapManager.inst.currentMap.GetWallAtPos(wallPos); Wall wallAtPos = MapManager.inst.currentMap.GetWallAtPos(wallPos);
if (wallAtPos != null) // have wall at wallpos if (wallAtPos != null) // have wall at wallpos
{
if (MapManager.inst.currentMap.wallGrid.ContainsKey(oppWallPos) && wallAtPos.type == WallType.Mirror) // change to Mirror
{
MapManager.inst.currentMap.ChangeToMirror(oppWallPos);
}
else // create wall
{ {
Pair wallPair = new Pair(PointToParRay(stPos, wallAtPos.ldPos, true), PointToParRay(stPos, wallAtPos.rdPos, true)); Pair wallPair = new Pair(PointToParRay(stPos, wallAtPos.ldPos, true), PointToParRay(stPos, wallAtPos.rdPos, true));
if (wallPair.l > wallPair.r) wallPair = wallPair.Swap(); if (wallPair.l > wallPair.r) wallPair = wallPair.Swap();
...@@ -143,13 +135,17 @@ public class Mirror : Wall, IBulletInteractor, IBreakable ...@@ -143,13 +135,17 @@ public class Mirror : Wall, IBulletInteractor, IBreakable
{ {
MapManager.inst.currentMap.CreateWall(oppWallPos, wallAtPos.type); MapManager.inst.currentMap.CreateWall(oppWallPos, wallAtPos.type);
SubtractRay(parRay, wallPair); SubtractRay(parRay, wallPair);
if (wallAtPos.type == WallType.Mirror) // change to Mirror
{
MapManager.inst.currentMap.ChangeToMirror(oppWallPos);
} }
} }
} }
else if (MapManager.inst.currentMap.GetWallAtPos(oppWallPos) != null) // no wall at wallPos but have at opposite else if (MapManager.inst.currentMap.GetWallAtPos(oppWallPos) != null) // no wall at wallPos but have at opposite
{ {
// remove wall Pair tempPair = new Pair(PointToParRay(stPos, wallPos + (dir ? new Vector2(-0.5f, 0) : new Vector2(0, -0.5f)), true), PointToParRay(stPos, wallPos + (dir ? new Vector2(0.5f, 0) : new Vector2(0, 0.5f)), true));
MapManager.inst.currentMap.RemoveWall(oppWallPos); if (IsInRay(parRay, tempPair)) MapManager.inst.currentMap.RemoveWall(oppWallPos);
} }
// copy / remove floor and object // copy / remove floor and object
Vector2 pointPos = dir ? new Vector2(j, iMid) : new Vector2(iMid, j); Vector2 pointPos = dir ? new Vector2(j, iMid) : new Vector2(iMid, j);
...@@ -386,6 +382,22 @@ public class Mirror : Wall, IBulletInteractor, IBreakable ...@@ -386,6 +382,22 @@ public class Mirror : Wall, IBulletInteractor, IBreakable
return false; return false;
} }
bool IsInRayWeak(List<Pair> _parRay, Pair _range)
{
bool output = false;
foreach (Pair pair in _parRay)
{
//Debug.Log("IsinRay (" + pair.l + ", " + pair.r + ") " + _range.l + ", " + _range.r);
if (pair.r < _range.l || pair.l > _range.r) continue;
else
{
output = true;
break;
}
}
return output;
}
/// <summary> /// <summary>
/// calculate where _chPos is from _stPos /// calculate where _chPos is from _stPos
/// </summary> /// </summary>
......
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