Commit 86e9e440 authored by 15박보승's avatar 15박보승

IPlayerInteract 관련 작업중

parent 7bfd0710
This diff is collapsed.
fileFormatVersion: 2
guid: 5a6ac0928b41cf64ea0e67fc9218e39b
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
...@@ -10,9 +10,9 @@ public class TruthBullet : Bullet ...@@ -10,9 +10,9 @@ public class TruthBullet : Bullet
{ {
other.GetComponent<IBreakable>().Break(); other.GetComponent<IBreakable>().Break();
} }
else if (other.GetComponent<IInteractor>() != null) else if (other.GetComponent<IBulletInteractor>() != null)
{ {
other.GetComponent<IInteractor>().Interact(this); other.GetComponent<IBulletInteractor>().Interact(this);
} }
Destroy(gameObject); Destroy(gameObject);
} }
......
...@@ -2,10 +2,22 @@ ...@@ -2,10 +2,22 @@
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
public class CameraTurret : MonoBehaviour, IBreakable public class CameraTurret : MonoBehaviour, IBreakable, IPlayerInteractor
{ {
private Vector2Int position;
public void Init(Vector2Int pos)
{
position = pos;
}
public void Break() public void Break()
{ {
Destroy(gameObject); Destroy(gameObject);
} }
public void Interact(Vector2Int pos)
{
}
} }
...@@ -2,7 +2,12 @@ ...@@ -2,7 +2,12 @@
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
public interface IInteractor public interface IBulletInteractor
{ {
void Interact(Bullet bullet); void Interact(Bullet bullet);
}
public interface IPlayerInteractor
{
void Interact(Vector2Int position);
} }
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
public class Mannequin : MonoBehaviour, IInteractor public class Mannequin : MonoBehaviour, IBulletInteractor
{ {
public Color Color { public Color Color {
get get
......
...@@ -3,7 +3,7 @@ using System.Collections.Generic; ...@@ -3,7 +3,7 @@ using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using UnityEngine.AI; using UnityEngine.AI;
public class Mirror : MonoBehaviour, IInteractor, IBreakable public class Mirror : MonoBehaviour, IBulletInteractor, IBreakable
{ {
private Camera camera; private Camera camera;
private RenderTexture rt; private RenderTexture rt;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
public class NormalWall : MonoBehaviour, IInteractor public class NormalWall : MonoBehaviour, IBulletInteractor
{ {
public void Interact(Bullet bullet) public void Interact(Bullet bullet)
{ {
......
fileFormatVersion: 2 fileFormatVersion: 2
guid: f6226b2548447a54486acfc694a44e4d guid: e31b766c78dd4084ea268dce5ba8df43
folderAsset: yes folderAsset: yes
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
......
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Linq;
public class GameManager : SingletonBehaviour<GameManager>
{
private List<IPlayerInteractor> playerInteractors;
public void UpdateInteractorList()
{
playerInteractors = FindObjectsOfType<MonoBehaviour>().OfType<IPlayerInteractor>().ToList();
}
}
fileFormatVersion: 2
guid: f94477ce50cfef746baa12d77bb9d4eb
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
...@@ -5,15 +5,32 @@ using UnityEngine.AI; ...@@ -5,15 +5,32 @@ using UnityEngine.AI;
public class PlayerController : MonoBehaviour public class PlayerController : MonoBehaviour
{ {
private Vector2Int prePos;
public Vector2Int MapPos
{
get
{
Vector2Int pos = Vector2Int.zero;
pos.x = Mathf.RoundToInt(transform.position.x);
pos.y = Mathf.RoundToInt(transform.position.y);
return pos;
}
}
// Start is called before the first frame update // Start is called before the first frame update
void Start() void Start()
{ {
prePos = MapPos;
} }
// Update is called once per frame // Update is called once per frame
void Update() void Update()
{ {
if (prePos != MapPos)
{
}
if (Input.GetMouseButtonDown(0)) if (Input.GetMouseButtonDown(0))
{ {
Ray mouseRay = Camera.main.ScreenPointToRay(Input.mousePosition); Ray mouseRay = Camera.main.ScreenPointToRay(Input.mousePosition);
...@@ -21,9 +38,19 @@ public class PlayerController : MonoBehaviour ...@@ -21,9 +38,19 @@ public class PlayerController : MonoBehaviour
if (Physics.Raycast(mouseRay, out hit) && hit.collider.gameObject.tag.Equals("floor")) if (Physics.Raycast(mouseRay, out hit) && hit.collider.gameObject.tag.Equals("floor"))
{ {
GetComponent<NavMeshAgent>().SetDestination(hit.collider.gameObject.transform.position); GetComponent<NavMeshAgent>().SetDestination(hit.collider.gameObject.transform.position);
Debug.Log(hit.collider.gameObject.GetComponent<Floor>().mapPos); //Debug.Log(hit.collider.gameObject.GetComponent<Floor>().mapPos);
Debug.Log(hit.collider.gameObject.tag); //Debug.Log(hit.collider.gameObject.tag);
} }
} }
} }
private void OnCollisionEnter(Collision collision)
{
Debug.Log(collision.gameObject.name);
Floor floor = collision.transform.GetComponent<Floor>();
if (floor != null)
{
Debug.Log(floor.mapPos);
}
}
} }
...@@ -29,9 +29,16 @@ QualitySettings: ...@@ -29,9 +29,16 @@ QualitySettings:
vSyncCount: 0 vSyncCount: 0
lodBias: 0.3 lodBias: 0.3
maximumLODLevel: 0 maximumLODLevel: 0
streamingMipmapsActive: 0
streamingMipmapsAddAllCameras: 1
streamingMipmapsMemoryBudget: 512
streamingMipmapsRenderersPerFrame: 512
streamingMipmapsMaxLevelReduction: 2
streamingMipmapsMaxFileIORequests: 1024
particleRaycastBudget: 4 particleRaycastBudget: 4
asyncUploadTimeSlice: 2 asyncUploadTimeSlice: 2
asyncUploadBufferSize: 16 asyncUploadBufferSize: 16
asyncUploadPersistentBuffer: 1
resolutionScalingFixedDPIFactor: 1 resolutionScalingFixedDPIFactor: 1
excludedTargetPlatforms: [] excludedTargetPlatforms: []
- serializedVersion: 2 - serializedVersion: 2
...@@ -57,9 +64,16 @@ QualitySettings: ...@@ -57,9 +64,16 @@ QualitySettings:
vSyncCount: 0 vSyncCount: 0
lodBias: 0.4 lodBias: 0.4
maximumLODLevel: 0 maximumLODLevel: 0
streamingMipmapsActive: 0
streamingMipmapsAddAllCameras: 1
streamingMipmapsMemoryBudget: 512
streamingMipmapsRenderersPerFrame: 512
streamingMipmapsMaxLevelReduction: 2
streamingMipmapsMaxFileIORequests: 1024
particleRaycastBudget: 16 particleRaycastBudget: 16
asyncUploadTimeSlice: 2 asyncUploadTimeSlice: 2
asyncUploadBufferSize: 16 asyncUploadBufferSize: 16
asyncUploadPersistentBuffer: 1
resolutionScalingFixedDPIFactor: 1 resolutionScalingFixedDPIFactor: 1
excludedTargetPlatforms: [] excludedTargetPlatforms: []
- serializedVersion: 2 - serializedVersion: 2
...@@ -85,9 +99,16 @@ QualitySettings: ...@@ -85,9 +99,16 @@ QualitySettings:
vSyncCount: 1 vSyncCount: 1
lodBias: 0.7 lodBias: 0.7
maximumLODLevel: 0 maximumLODLevel: 0
streamingMipmapsActive: 0
streamingMipmapsAddAllCameras: 1
streamingMipmapsMemoryBudget: 512
streamingMipmapsRenderersPerFrame: 512
streamingMipmapsMaxLevelReduction: 2
streamingMipmapsMaxFileIORequests: 1024
particleRaycastBudget: 64 particleRaycastBudget: 64
asyncUploadTimeSlice: 2 asyncUploadTimeSlice: 2
asyncUploadBufferSize: 16 asyncUploadBufferSize: 16
asyncUploadPersistentBuffer: 1
resolutionScalingFixedDPIFactor: 1 resolutionScalingFixedDPIFactor: 1
excludedTargetPlatforms: [] excludedTargetPlatforms: []
- serializedVersion: 2 - serializedVersion: 2
...@@ -113,9 +134,16 @@ QualitySettings: ...@@ -113,9 +134,16 @@ QualitySettings:
vSyncCount: 1 vSyncCount: 1
lodBias: 1 lodBias: 1
maximumLODLevel: 0 maximumLODLevel: 0
streamingMipmapsActive: 0
streamingMipmapsAddAllCameras: 1
streamingMipmapsMemoryBudget: 512
streamingMipmapsRenderersPerFrame: 512
streamingMipmapsMaxLevelReduction: 2
streamingMipmapsMaxFileIORequests: 1024
particleRaycastBudget: 256 particleRaycastBudget: 256
asyncUploadTimeSlice: 2 asyncUploadTimeSlice: 2
asyncUploadBufferSize: 16 asyncUploadBufferSize: 16
asyncUploadPersistentBuffer: 1
resolutionScalingFixedDPIFactor: 1 resolutionScalingFixedDPIFactor: 1
excludedTargetPlatforms: [] excludedTargetPlatforms: []
- serializedVersion: 2 - serializedVersion: 2
...@@ -141,9 +169,16 @@ QualitySettings: ...@@ -141,9 +169,16 @@ QualitySettings:
vSyncCount: 1 vSyncCount: 1
lodBias: 1.5 lodBias: 1.5
maximumLODLevel: 0 maximumLODLevel: 0
streamingMipmapsActive: 0
streamingMipmapsAddAllCameras: 1
streamingMipmapsMemoryBudget: 512
streamingMipmapsRenderersPerFrame: 512
streamingMipmapsMaxLevelReduction: 2
streamingMipmapsMaxFileIORequests: 1024
particleRaycastBudget: 1024 particleRaycastBudget: 1024
asyncUploadTimeSlice: 2 asyncUploadTimeSlice: 2
asyncUploadBufferSize: 16 asyncUploadBufferSize: 16
asyncUploadPersistentBuffer: 1
resolutionScalingFixedDPIFactor: 1 resolutionScalingFixedDPIFactor: 1
excludedTargetPlatforms: [] excludedTargetPlatforms: []
- serializedVersion: 2 - serializedVersion: 2
...@@ -169,22 +204,16 @@ QualitySettings: ...@@ -169,22 +204,16 @@ QualitySettings:
vSyncCount: 1 vSyncCount: 1
lodBias: 2 lodBias: 2
maximumLODLevel: 0 maximumLODLevel: 0
streamingMipmapsActive: 0
streamingMipmapsAddAllCameras: 1
streamingMipmapsMemoryBudget: 512
streamingMipmapsRenderersPerFrame: 512
streamingMipmapsMaxLevelReduction: 2
streamingMipmapsMaxFileIORequests: 1024
particleRaycastBudget: 4096 particleRaycastBudget: 4096
asyncUploadTimeSlice: 2 asyncUploadTimeSlice: 2
asyncUploadBufferSize: 16 asyncUploadBufferSize: 16
asyncUploadPersistentBuffer: 1
resolutionScalingFixedDPIFactor: 1 resolutionScalingFixedDPIFactor: 1
excludedTargetPlatforms: [] excludedTargetPlatforms: []
m_PerPlatformDefaultQuality: m_PerPlatformDefaultQuality: {}
Android: 2
Nintendo 3DS: 5
Nintendo Switch: 5
PS4: 5
PSP2: 2
Standalone: 5
Tizen: 2
WebGL: 3
WiiU: 5
Windows Store Apps: 5
XboxOne: 5
iPhone: 2
tvOS: 2
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
UnityConnectSettings: UnityConnectSettings:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
serializedVersion: 1 serializedVersion: 1
m_Enabled: 0 m_Enabled: 1
m_TestMode: 0 m_TestMode: 0
m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events
m_EventUrl: https://cdp.cloud.unity3d.com/v1/events m_EventUrl: https://cdp.cloud.unity3d.com/v1/events
......
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