Commit 23a3f113 authored by 18신대성's avatar 18신대성

이제 에임한데 위치쯤 갔는데도 안맞으면 강제로 트리거 발동하게 함

parent d75e2966
...@@ -759,7 +759,7 @@ GameObject: ...@@ -759,7 +759,7 @@ GameObject:
- component: {fileID: 439939669} - component: {fileID: 439939669}
- component: {fileID: 896145114} - component: {fileID: 896145114}
- component: {fileID: 7514060783340336889} - component: {fileID: 7514060783340336889}
- component: {fileID: 1382926052388863002} - component: {fileID: 1747759991329878593}
m_Layer: 0 m_Layer: 0
m_Name: camera m_Name: camera
m_TagString: CameraTurret m_TagString: CameraTurret
...@@ -842,8 +842,8 @@ NavMeshObstacle: ...@@ -842,8 +842,8 @@ NavMeshObstacle:
m_CarveOnlyStationary: 1 m_CarveOnlyStationary: 1
m_Center: {x: 0, y: 0.5, z: 0} m_Center: {x: 0, y: 0.5, z: 0}
m_TimeToStationary: 0.5 m_TimeToStationary: 0.5
--- !u!136 &1382926052388863002 --- !u!135 &1747759991329878593
CapsuleCollider: SphereCollider:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
...@@ -852,10 +852,9 @@ CapsuleCollider: ...@@ -852,10 +852,9 @@ CapsuleCollider:
m_Material: {fileID: 0} m_Material: {fileID: 0}
m_IsTrigger: 1 m_IsTrigger: 1
m_Enabled: 1 m_Enabled: 1
m_Radius: 0.24 serializedVersion: 2
m_Height: 0.7 m_Radius: 0.23
m_Direction: 1 m_Center: {x: 0, y: 0.47, z: 0}
m_Center: {x: 0, y: 0.5, z: 0}
--- !u!1 &6001025753464815807 --- !u!1 &6001025753464815807
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
......
This diff is collapsed.
...@@ -542,25 +542,13 @@ PrefabInstance: ...@@ -542,25 +542,13 @@ PrefabInstance:
propertyPath: m_AnchorMax.y propertyPath: m_AnchorMax.y
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 209951667, guid: 8115fd4d1a1025b4fb05e45fc5fa6578, type: 3}
propertyPath: m_Color.r
value: 0.41509432
objectReference: {fileID: 0}
- target: {fileID: 209951667, guid: 8115fd4d1a1025b4fb05e45fc5fa6578, type: 3}
propertyPath: m_Color.g
value: 0.41509432
objectReference: {fileID: 0}
- target: {fileID: 209951667, guid: 8115fd4d1a1025b4fb05e45fc5fa6578, type: 3}
propertyPath: m_Color.b
value: 0.41509432
objectReference: {fileID: 0}
- target: {fileID: 209951667, guid: 8115fd4d1a1025b4fb05e45fc5fa6578, type: 3}
propertyPath: m_Color.a
value: 0.8745098
objectReference: {fileID: 0}
- target: {fileID: 12888245, guid: 8115fd4d1a1025b4fb05e45fc5fa6578, type: 3} - target: {fileID: 12888245, guid: 8115fd4d1a1025b4fb05e45fc5fa6578, type: 3}
propertyPath: m_IsActive propertyPath: m_IsActive
value: 1 value: 1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 707928317, guid: 8115fd4d1a1025b4fb05e45fc5fa6578, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 8115fd4d1a1025b4fb05e45fc5fa6578, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 8115fd4d1a1025b4fb05e45fc5fa6578, type: 3}
...@@ -17,10 +17,20 @@ public abstract class Bullet : MonoBehaviour ...@@ -17,10 +17,20 @@ public abstract class Bullet : MonoBehaviour
GameManager.inst.isBulletFlying = false; GameManager.inst.isBulletFlying = false;
} }
public void Init(Vector3 velocity) IEnumerator ForceInteract(Collider col, float _time)
{
yield return new WaitForSeconds(_time);
OnTriggerEnter(col);
}
public void Init(Vector3 velocity, Collider col)
{ {
GameManager.inst.isBulletFlying = true; GameManager.inst.isBulletFlying = true;
GetComponent<Rigidbody>().velocity = velocity; GetComponent<Rigidbody>().velocity = velocity;
Destroy(gameObject, MapManager.inst.currentMap.maxMapSize / velocity.magnitude); float flightTime;
if (col != null) flightTime = (col.transform.position - transform.position).magnitude / velocity.magnitude;
else flightTime = MapManager.inst.currentMap.maxMapSize / velocity.magnitude;
StartCoroutine(ForceInteract(col, flightTime));
Destroy(gameObject, flightTime + 0.5f);
} }
} }
...@@ -91,7 +91,7 @@ public class CameraController : MonoBehaviour ...@@ -91,7 +91,7 @@ public class CameraController : MonoBehaviour
for (i = 0; i < cameraMoveDuration; i += 1) for (i = 0; i < cameraMoveDuration; i += 1)
{ {
yield return new WaitForSeconds(0.01f); yield return new WaitForSeconds(0.01f);
if (Input.GetMouseButtonDown(0)) if (Input.GetMouseButtonDown(0) || !StageSelector.inst.gameSettings["zoomAnim"])
break; break;
transform.position += posDiff; transform.position += posDiff;
transform.eulerAngles += new Vector3(angleDiff, 0, 0); transform.eulerAngles += new Vector3(angleDiff, 0, 0);
...@@ -140,7 +140,7 @@ public class CameraController : MonoBehaviour ...@@ -140,7 +140,7 @@ public class CameraController : MonoBehaviour
for (i = 0; i < cameraMoveDuration; i += 1) for (i = 0; i < cameraMoveDuration; i += 1)
{ {
yield return new WaitForSeconds(0.01f); yield return new WaitForSeconds(0.01f);
if (Input.GetMouseButtonDown(0)) if (Input.GetMouseButtonDown(0) || !StageSelector.inst.gameSettings["zoomAnim"])
break; break;
transform.position += posDiff; transform.position += posDiff;
transform.eulerAngles += angleDiff; transform.eulerAngles += angleDiff;
......
...@@ -25,9 +25,10 @@ public class Player : MonoBehaviour ...@@ -25,9 +25,10 @@ public class Player : MonoBehaviour
public VLight aimLight; public VLight aimLight;
public bool canShoot = false; public bool canShoot = false;
public Collider lastCol = null;
private Collider beforeRay = null;
private GameObject currentBullet; private GameObject currentBullet;
private float lastShoot; private float lastShoot;
private Collider beforeRay = null;
/// <summary> /// <summary>
/// Set this player as the current player. /// Set this player as the current player.
...@@ -153,7 +154,7 @@ public class Player : MonoBehaviour ...@@ -153,7 +154,7 @@ public class Player : MonoBehaviour
Bullet newBullet = MapManager.inst.bulletFactory.MakeBullet(bulletCode); Bullet newBullet = MapManager.inst.bulletFactory.MakeBullet(bulletCode);
newBullet.transform.position = shootingFinger.transform.position; newBullet.transform.position = shootingFinger.transform.position;
newBullet.transform.LookAt(shootingArm.transform.forward + newBullet.transform.position); newBullet.transform.LookAt(shootingArm.transform.forward + newBullet.transform.position);
newBullet.Init(shootingArm.transform.forward * 3); newBullet.Init(shootingArm.transform.forward * 3, lastCol);
currentBullet = newBullet.gameObject; currentBullet = newBullet.gameObject;
PlayerController.inst.bulletList.RemoveAt(0); PlayerController.inst.bulletList.RemoveAt(0);
GameManager.inst.bulletUIGenerator.RemoveBulletUI(); GameManager.inst.bulletUIGenerator.RemoveBulletUI();
...@@ -164,6 +165,7 @@ public class Player : MonoBehaviour ...@@ -164,6 +165,7 @@ public class Player : MonoBehaviour
public void OffAllOutline() public void OffAllOutline()
{ {
canShoot = false; canShoot = false;
if (beforeRay != null) lastCol = beforeRay;
laser.GetComponent<LineRenderer>().startColor = Color.red; laser.GetComponent<LineRenderer>().startColor = Color.red;
laser.GetComponent<LineRenderer>().endColor = Color.red; laser.GetComponent<LineRenderer>().endColor = Color.red;
if (beforeRay != null) if (beforeRay != null)
......
...@@ -17,7 +17,8 @@ public class StageSelector : SingletonBehaviour<StageSelector> ...@@ -17,7 +17,8 @@ public class StageSelector : SingletonBehaviour<StageSelector>
public Dictionary<string, bool> gameSettings = new Dictionary<string, bool>() public Dictionary<string, bool> gameSettings = new Dictionary<string, bool>()
{ {
{ "postProcessing", true }, { "postProcessing", true },
{ "sound", true } { "sound", true },
{ "zoomAnim", true }
}; };
[Header("맵 추가시 반드시 바꿔줘야하는 값.각 카테고리마다의 스테이지 수")] [Header("맵 추가시 반드시 바꿔줘야하는 값.각 카테고리마다의 스테이지 수")]
......
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