Commit 71c15b22 authored by 18손재민's avatar 18손재민 Committed by 15박보승

이제 카메라 터렛이 벽을 넘어 공격하지 않음

parent 6f0aa517
fileFormatVersion: 2
guid: 47baf9abe59c90a4d914127b0527c24f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
...@@ -6,6 +6,7 @@ public class Briefcase : MonoBehaviour, IObject, IPlayerInteractor ...@@ -6,6 +6,7 @@ public class Briefcase : MonoBehaviour, IObject, IPlayerInteractor
{ {
[SerializeField] [SerializeField]
private Floor floor = null; private Floor floor = null;
private BulletCode dropBullet;
public Vector2Int Position { get { return floor != null ? floor.mapPos : throw new UnassignedReferenceException("Floor of Interactor is not assigned"); } } public Vector2Int Position { get { return floor != null ? floor.mapPos : throw new UnassignedReferenceException("Floor of Interactor is not assigned"); } }
public GameObject GetObject() public GameObject GetObject()
...@@ -26,10 +27,16 @@ public class Briefcase : MonoBehaviour, IObject, IPlayerInteractor ...@@ -26,10 +27,16 @@ public class Briefcase : MonoBehaviour, IObject, IPlayerInteractor
PlayerController.inst.OnPlayerMove += Interact; PlayerController.inst.OnPlayerMove += Interact;
} }
public void SetBullet(BulletCode _dropBullet)
{
dropBullet = _dropBullet;
}
public void Interact(Vector2Int position) public void Interact(Vector2Int position)
{ {
Debug.Log(Position + " " + position); Debug.Log(Position + " " + position);
if (Position == position) PlayerController.inst.bulletList.Add(dropBullet);
if (Position == position)
{ {
if (GameManager.aCase >= 0) if (GameManager.aCase >= 0)
MapManager.inst.currentMap.clearConditions[GameManager.aCase].IsDone(1); MapManager.inst.currentMap.clearConditions[GameManager.aCase].IsDone(1);
......
...@@ -26,9 +26,9 @@ public class CameraTurret : MonoBehaviour, IObject, IBreakable, IPlayerInteracto ...@@ -26,9 +26,9 @@ public class CameraTurret : MonoBehaviour, IObject, IBreakable, IPlayerInteracto
public void Interact(Vector2Int pos) public void Interact(Vector2Int pos)
{ {
if (Position.IsInAdjacentArea(pos, 1)) if (Position.IsInAdjacentArea(pos, 1) && MapManager.inst.currentMap.GetWallAtPos((Vector2)(Position + pos) / 2) == null)
{ {
Debug.Log(Position.x + " " + Position.y +" Stage Restart!"); Debug.Log(Position.x + " " + Position.y + " Stage Restart!");
//TODO : Restart Level //TODO : Restart Level
} }
} }
......
...@@ -112,6 +112,11 @@ public class PlayerController : SingletonBehaviour<PlayerController> ...@@ -112,6 +112,11 @@ public class PlayerController : SingletonBehaviour<PlayerController>
} }
} }
public void AddBullet(BulletCode newBullet)
{
bulletList.Add(newBullet);
}
//For test //For test
public string GetCurrentBullet() public string GetCurrentBullet()
{ {
......
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