Commit 8716777e authored by 18신대성's avatar 18신대성

거울에 보이는 회전각도로 생성되게 만듬, 플레이어 콜라이더 더 조정,

parent 1fe64d95
......@@ -1417,10 +1417,10 @@ CapsuleCollider:
m_Material: {fileID: 0}
m_IsTrigger: 1
m_Enabled: 1
m_Radius: 0.11
m_Height: 1.6
m_Radius: 0.2
m_Height: 2
m_Direction: 1
m_Center: {x: 0, y: 1, z: 0}
m_Center: {x: 0, y: 1.1, z: 0}
--- !u!114 &6489731509539496108
MonoBehaviour:
m_ObjectHideFlags: 0
......@@ -2537,7 +2537,7 @@ GameObject:
- component: {fileID: 3848187736642518088}
- component: {fileID: 886384046876709786}
- component: {fileID: 2401818891807728848}
m_Layer: 8
m_Layer: 11
m_Name: V-Light Spot 0
m_TagString: Untagged
m_Icon: {fileID: 0}
......
......@@ -311,7 +311,7 @@ Light:
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_RenderMode: 1
m_CullingMask:
serializedVersion: 2
m_Bits: 7991
......@@ -402,7 +402,7 @@ Light:
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_RenderMode: 1
m_CullingMask:
serializedVersion: 2
m_Bits: 7991
......@@ -994,7 +994,7 @@ Light:
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_RenderMode: 1
m_CullingMask:
serializedVersion: 2
m_Bits: 7991
......@@ -1646,7 +1646,7 @@ Light:
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_RenderMode: 1
m_CullingMask:
serializedVersion: 2
m_Bits: 7991
......
......@@ -6,7 +6,7 @@ public class FakeBullet : Bullet
{
protected override void OnTriggerEnter(Collider other)
{
if (other.gameObject.layer != LayerMask.NameToLayer("Scattered"))
if (other.gameObject.layer != LayerMask.NameToLayer("Scattered") && other.gameObject.layer != LayerMask.NameToLayer("Player"))
{
if (other.GetComponent<IBulletInteractor>() != null)
{
......
......@@ -6,7 +6,7 @@ public class MirrorBullet : Bullet
{
protected override void OnTriggerEnter(Collider other)
{
if (other.gameObject.layer != LayerMask.NameToLayer("Scattered"))
if (other.gameObject.layer != LayerMask.NameToLayer("Scattered") && other.gameObject.layer != LayerMask.NameToLayer("Player"))
{
if (other.GetComponent<IBulletInteractor>() != null)
{
......
......@@ -6,7 +6,7 @@ public class TruthBullet : Bullet
{
protected override void OnTriggerEnter(Collider other)
{
if (other.gameObject.layer != LayerMask.NameToLayer("Scattered"))
if (other.gameObject.layer != LayerMask.NameToLayer("Scattered") && other.gameObject.layer != LayerMask.NameToLayer("Player"))
{
if (other.GetComponent<IBreakable>() != null)
{
......
......@@ -186,11 +186,7 @@ public class Mirror : Wall, IBulletInteractor, IBreakable
if (oppoFloor.isPlayerOn) PlayerController.inst.RemovePlayer(oppoFloor);
if (oppoFloor.objOnFloor != null) MapManager.inst.currentMap.RemoveObject(oppoPos);
}
else
{
oppoFloor = MapManager.inst.currentMap.GetFloorAtPos(oppoPos);
}
if (originFloor.isPlayerOn && oppoFloor != null) PlayerController.inst.CreatePlayer(oppoFloor);
if (originFloor.isPlayerOn) PlayerController.inst.CreatePlayer(oppoPos, floorCount.Key, dir);
else if (originFloor.objOnFloor != null)
{
IObject obj = originFloor.objOnFloor;
......@@ -198,6 +194,15 @@ public class Mirror : Wall, IBulletInteractor, IBreakable
{
case ObjType.Mannequin:
MapManager.inst.currentMap.CreateObject(oppoPos, ObjType.Mannequin, (obj as Mannequin).isWhite);
GameObject tempMann = MapManager.inst.currentMap.GetObjectAtPos(floorCount.Key).GetObject();
GameObject oppoMann = MapManager.inst.currentMap.GetObjectAtPos(oppoPos).GetObject();
Quaternion mirroredRotation = tempMann.transform.rotation;
Vector3 mirroredScale = tempMann.transform.localScale;
mirroredRotation.w *= -1;
if (dir) { mirroredRotation.z *= -1; mirroredScale.z *= -1; }
else { mirroredRotation.x *= -1; mirroredScale.x *= -1; }
oppoMann.transform.rotation = mirroredRotation;
oppoMann.transform.localScale = mirroredScale;
break;
case ObjType.Briefcase:
MapManager.inst.currentMap.CreateObject(oppoPos, ObjType.Briefcase, (obj as Briefcase).dropBullet);
......
......@@ -147,7 +147,7 @@ public class Player : MonoBehaviour
// Update is called once per frame
void Update()
{
if (GameManager.inst.isPlayerShooting && !GameManager.inst.isZooming)
if (PlayerController.inst.currentPlayer == this && GameManager.inst.isPlayerShooting && !GameManager.inst.isZooming)
{
laser.transform.position = shootingFinger.transform.position;
if (currentBullet == null && lastShoot + 1f < Time.time) laser.SetActive(true);
......
......@@ -25,14 +25,14 @@ public class PlayerController : SingletonBehaviour<PlayerController>
public event Action<Vector2Int> OnPlayerMove;
public void CreatePlayer(Floor floor)
public GameObject CreatePlayer(Floor floor)
{
foreach (var obj in MapManager.inst.players)
{
if (obj.GetComponent<Player>().currentFloor == floor)
{
Debug.Log("Player already exists on that floor.");
return;
return null;
}
}
GameObject player = Instantiate(MapManager.inst.player, floor.transform.position + new Vector3(0, 0.1f, 0), Quaternion.identity);
......@@ -45,11 +45,30 @@ public class PlayerController : SingletonBehaviour<PlayerController>
MapManager.inst.currentMap.clearConditions[GameManager.nPlayer].IsDone();
}
CheckCurrentFloors();
return player;
}
public void CreatePlayer(Vector2Int floorPos)
public void CreatePlayer(Vector2Int floorPos, Vector2Int originPos, bool dir)
{
List<GameObject> copyPlayers = new List<GameObject>(MapManager.inst.players);
Floor originFloor = MapManager.inst.currentMap.GetFloorAtPos(originPos);
Quaternion mirroredRotation = Quaternion.identity;
foreach (var obj in copyPlayers)
{
if (obj.GetComponent<Player>().currentFloor == originFloor)
{
mirroredRotation = obj.transform.rotation;
break;
}
}
mirroredRotation.y *= -1;
if (dir) { mirroredRotation.x *= -1; mirroredRotation = Quaternion.Euler(mirroredRotation.eulerAngles + new Vector3(0, 180, 0)); }
else mirroredRotation.z *= -1;
if (MapManager.inst.currentMap.floorGrid.TryGetValue(floorPos, out Floor floor))
CreatePlayer(floor);
{
GameObject player = CreatePlayer(floor);
player.transform.rotation = mirroredRotation;
}
else
Debug.Log("there are no floor");
}
......
......@@ -61,6 +61,7 @@ public class BulletUIGenerator : MonoBehaviour
if (uiList.Count == 0)
{
posX -= 55;
targetBulletUI.SetActive(false);
}
......
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