Commit b75e4a05 authored by 18신대성's avatar 18신대성

여러번 클릭시 계속 빨라지는거 방지

parent bc9155e0
......@@ -57,7 +57,7 @@ public class Briefcase : MonoBehaviour, IObject, IPlayerInteractor
{
if(!GameManager.inst.isGameOver)
{
Debug.Log(Position + " " + position);
//Debug.Log(Position + " " + position);
if (Position == position)
{
if (dropBullet != BulletCode.None)
......
......@@ -22,7 +22,7 @@ public class GameManager : SingletonBehaviour<GameManager>
[Header("Stage Data")]
public bool isGameOver = false;
public bool isPlayerMoving, isPlayerShooting, isZooming, isBulletFlying;
public bool isPlayerMoving, isPlayerShooting, isZooming, isBulletFlying, isFast;
public int[] clearIndex = new int[9];
public int clearCounter = 0;
......
......@@ -88,6 +88,7 @@ public class Player : MonoBehaviour
anim.SetBool("isWalking", false);
anim.speed = 1;
GetComponent<NavMeshAgent>().speed = 1.5f;
GameManager.inst.isFast = false;
GameManager.inst.isPlayerMoving = false;
}
/// <summary>
......
......@@ -200,10 +200,11 @@ public class PlayerController : SingletonBehaviour<PlayerController>
currentPlayer.Shoot(bulletList[0]);
}
}
else if (GameManager.inst.isPlayerMoving)
else if (GameManager.inst.isPlayerMoving && !GameManager.inst.isFast)
{
currentPlayer.GetComponent<NavMeshAgent>().speed *= 5;
currentPlayer.anim.speed *= 5;
GameManager.inst.isFast = true;
}
}
else if (Input.GetMouseButtonDown(1) && GameManager.inst.isPlayerShooting)
......
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