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

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

parent 90a0a3ed
......@@ -61,7 +61,7 @@ Material:
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _Glossiness: 0
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
......@@ -73,5 +73,5 @@ Material:
- _UVSec: 0
- _ZWrite: 1
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}
{"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:
propertyPath: commentUIGenerator
value:
objectReference: {fileID: 158856774}
- target: {fileID: 2122327709, guid: 42247a938bb6e554eb00dc08303a72d6, type: 3}
propertyPath: currentStage
value:
objectReference: {fileID: 0}
- target: {fileID: 52444459818764334, guid: 42247a938bb6e554eb00dc08303a72d6,
type: 3}
propertyPath: m_Name
......
......@@ -78,7 +78,11 @@ public class Map : MonoBehaviour
StartCoroutine(MapManager.inst.Rebaker());
}
else
{
Debug.Log("Floor already exists at : (" + pos.x + ", " + pos.y + ")");
floorGrid[pos].isGoalFloor = isGoal;
floorGrid[pos].RefreshGoal();
}
}
/// <summary>
/// Create floor in rectangular area between pos1 and pos2.
......
......@@ -96,26 +96,24 @@ public class Mirror : Wall, IBulletInteractor, IBreakable
Wall wallAtPos = MapManager.inst.currentMap.GetWallAtPos(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));
if (wallPair.l > wallPair.r) wallPair = wallPair.Swap();
if (IsInRay(parRay, wallPair))
{
Pair wallPair = new Pair(PointToParRay(stPos, wallAtPos.ldPos, true), PointToParRay(stPos, wallAtPos.rdPos, true));
if (wallPair.l > wallPair.r) wallPair = wallPair.Swap();
MapManager.inst.currentMap.CreateWall(oppWallPos, wallAtPos.type);
SubtractRay(parRay, wallPair);
if (IsInRay(parRay, wallPair))
if (wallAtPos.type == WallType.Mirror) // change to Mirror
{
MapManager.inst.currentMap.CreateWall(oppWallPos, wallAtPos.type);
SubtractRay(parRay, wallPair);
MapManager.inst.currentMap.ChangeToMirror(oppWallPos);
}
}
}
else if (MapManager.inst.currentMap.GetWallAtPos(oppWallPos) != null) // no wall at wallPos but have at opposite
{
// remove wall
MapManager.inst.currentMap.RemoveWall(oppWallPos);
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));
if (IsInRay(parRay, tempPair)) MapManager.inst.currentMap.RemoveWall(oppWallPos);
}
}
float iMid = i + 0.5f * side;
......@@ -130,26 +128,24 @@ public class Mirror : Wall, IBulletInteractor, IBreakable
Wall wallAtPos = MapManager.inst.currentMap.GetWallAtPos(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));
if (wallPair.l > wallPair.r) wallPair = wallPair.Swap();
if (IsInRay(parRay, wallPair))
{
Pair wallPair = new Pair(PointToParRay(stPos, wallAtPos.ldPos, true), PointToParRay(stPos, wallAtPos.rdPos, true));
if (wallPair.l > wallPair.r) wallPair = wallPair.Swap();
MapManager.inst.currentMap.CreateWall(oppWallPos, wallAtPos.type);
SubtractRay(parRay, wallPair);
if (IsInRay(parRay, wallPair))
if (wallAtPos.type == WallType.Mirror) // change to Mirror
{
MapManager.inst.currentMap.CreateWall(oppWallPos, wallAtPos.type);
SubtractRay(parRay, wallPair);
MapManager.inst.currentMap.ChangeToMirror(oppWallPos);
}
}
}
else if (MapManager.inst.currentMap.GetWallAtPos(oppWallPos) != null) // no wall at wallPos but have at opposite
{
// remove wall
MapManager.inst.currentMap.RemoveWall(oppWallPos);
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));
if (IsInRay(parRay, tempPair)) MapManager.inst.currentMap.RemoveWall(oppWallPos);
}
// copy / remove floor and object
Vector2 pointPos = dir ? new Vector2(j, iMid) : new Vector2(iMid, j);
......@@ -386,6 +382,22 @@ public class Mirror : Wall, IBulletInteractor, IBreakable
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>
/// calculate where _chPos is from _stPos
/// </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