Commit 6af24b92 authored by 18신대성's avatar 18신대성

플레이어 줌인 진입시간 변경, 탄이 부숴진 조각에 반응하는 오류 해결

parent 8ba3fda8
......@@ -6,10 +6,13 @@ public class FakeBullet : Bullet
{
protected override void OnTriggerEnter(Collider other)
{
if (other.GetComponent<IBulletInteractor>() != null)
if (other.gameObject.layer != LayerMask.NameToLayer("Scattered"))
{
other.GetComponent<IBulletInteractor>().Interact(this);
if (other.GetComponent<IBulletInteractor>() != null)
{
other.GetComponent<IBulletInteractor>().Interact(this);
}
Destroy(gameObject);
}
Destroy(gameObject);
}
}
......@@ -6,10 +6,13 @@ public class MirrorBullet : Bullet
{
protected override void OnTriggerEnter(Collider other)
{
if (other.GetComponent<IBulletInteractor>() != null)
{
other.GetComponent<IBulletInteractor>().Interact(this);
}
Destroy(gameObject);
if (other.gameObject.layer != LayerMask.NameToLayer("Scattered"))
{
if (other.GetComponent<IBulletInteractor>() != null)
{
other.GetComponent<IBulletInteractor>().Interact(this);
}
Destroy(gameObject);
}
}
}
\ No newline at end of file
......@@ -6,14 +6,17 @@ public class TruthBullet : Bullet
{
protected override void OnTriggerEnter(Collider other)
{
if (other.GetComponent<IBreakable>() != null)
if (other.gameObject.layer != LayerMask.NameToLayer("Scattered"))
{
other.GetComponent<IBreakable>().Break();
if (other.GetComponent<IBreakable>() != null)
{
other.GetComponent<IBreakable>().Break();
}
else if (other.GetComponent<IBulletInteractor>() != null)
{
other.GetComponent<IBulletInteractor>().Interact(this);
}
Destroy(gameObject);
}
else if (other.GetComponent<IBulletInteractor>() != null)
{
other.GetComponent<IBulletInteractor>().Interact(this);
}
Destroy(gameObject);
}
}
......@@ -140,7 +140,7 @@ public class Map : MonoBehaviour
}
if (!wallGrid.ContainsKey(pos))
{
if(wallType == WallType.Normal)
if (wallType == WallType.Normal)
wallGrid.Add(pos, Instantiate(MapManager.inst.normalWall, new Vector3(pos.x, 0, pos.y), Quaternion.identity, walls.transform).GetComponent<Wall>());
else if (wallType == WallType.Mirror)
wallGrid.Add(pos, Instantiate(MapManager.inst.mirror, new Vector3(pos.x, 0, pos.y), Quaternion.identity, walls.transform).GetComponent<Wall>());
......@@ -153,7 +153,13 @@ public class Map : MonoBehaviour
StartCoroutine(MapManager.inst.Rebaker());
}
else
{
Debug.Log("Wall already exists at : " + pos);
if (wallGrid[pos].type == WallType.Normal && wallType == WallType.Mirror) // change to Mirror
{
MapManager.inst.currentMap.ChangeToMirror(pos);
}
}
}
/// <summary>
/// Create walls from two floors, toward dir's direction.
......
......@@ -98,16 +98,11 @@ public class Mirror : Wall, IBulletInteractor, IBreakable
{
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))
{
MapManager.inst.currentMap.CreateWall(oppWallPos, wallAtPos.type);
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
......@@ -135,11 +130,6 @@ public class Mirror : Wall, IBulletInteractor, IBreakable
{
MapManager.inst.currentMap.CreateWall(oppWallPos, wallAtPos.type);
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
......
......@@ -98,13 +98,13 @@ public class Player : MonoBehaviour
public IEnumerator CountPlayerClick(float startTime)
{
float time = Time.time;
float endTime = startTime + 2;
float endTime = startTime + 1.5f;
aimLight.gameObject.SetActive(true);
while (time <= endTime)
{
yield return null;
aimLight.lightMultiplier += 3 * Time.deltaTime;
aimLight.spotAngle -= 30 * Time.deltaTime;
aimLight.spotAngle -= 40 * Time.deltaTime;
time = Time.time;
if (!Input.GetMouseButton(0))
{
......
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