Commit 81b44dfa authored by 15박보승's avatar 15박보승

서류 가방이 이제 총알을 지님

parent 71c15b22
......@@ -35,7 +35,7 @@ public class Briefcase : MonoBehaviour, IObject, IPlayerInteractor
public void Interact(Vector2Int position)
{
Debug.Log(Position + " " + position);
PlayerController.inst.bulletList.Add(dropBullet);
PlayerController.inst.AddBullet(dropBullet);
if (Position == position)
{
if (GameManager.aCase >= 0)
......
......@@ -81,7 +81,7 @@ public class MapManager : SingletonBehaviour<MapManager>
for (int i = 0; i < currentMap.startFloors.Count; i++)
PlayerController.inst.CreatePlayer(currentMap.startFloors[i]);
for (int i = 0; i < loadedMapData.bullets.Count; i++)
PlayerController.inst.bulletList.Add(loadedMapData.bullets[i]);
PlayerController.inst.AddBullet(loadedMapData.bullets[i]);
}
public IEnumerator Rebaker()
{
......
......@@ -106,6 +106,7 @@ public class Player : MonoBehaviour
newBullet.transform.position = shootingFinger.transform.position;
newBullet.transform.LookAt(shootingArm.transform.forward + newBullet.transform.position);
newBullet.Init(shootingArm.transform.forward);
PlayerController.inst.bulletList.RemoveAt(0);
}
private void OnTriggerEnter(Collider other)
......
......@@ -9,7 +9,6 @@ public class PlayerController : SingletonBehaviour<PlayerController>
public Player currentPlayer;
public bool isPlayerMoving, isPlayerShooting, isZooming;
public List<BulletCode> bulletList = new List<BulletCode>();
private int bulletCount = 0;
private Vector2Int prePos;
public Vector2Int MapPos
{
......@@ -120,7 +119,7 @@ public class PlayerController : SingletonBehaviour<PlayerController>
//For test
public string GetCurrentBullet()
{
return bulletList.Count > 0 ? bulletList[bulletCount].ToString() : null;
return bulletList.Count > 0 ? bulletList[0].ToString() : null;
}
// Start is called before the first frame update
......@@ -174,8 +173,7 @@ public class PlayerController : SingletonBehaviour<PlayerController>
{
if (bulletList.Count > 0)
{
currentPlayer.Shoot(bulletList[bulletCount]);
bulletList.RemoveAt(bulletCount);
currentPlayer.Shoot(bulletList[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