Hide objects in front of player
This commit is contained in:
@@ -9,7 +9,7 @@ public class PlayerManager : MonoBehaviour
|
||||
public Stat money = new Stat("Money", 100.0f);
|
||||
public Stat rentAccount = new Stat("Rent Account", 0);
|
||||
public Stat food = new Stat("Food Energy", 100);
|
||||
public Stat energy = new Stat("Energy", 12);
|
||||
public Stat energy = new Stat("Energy", 100);
|
||||
|
||||
// bank
|
||||
public Stat bankAccount = new Stat("Bank Account", 0);
|
||||
@@ -73,12 +73,13 @@ public class PlayerManager : MonoBehaviour
|
||||
if (Input.GetMouseButton(0))
|
||||
{
|
||||
Ray myRay = playerCamera.ScreenPointToRay(Input.mousePosition);
|
||||
|
||||
targetDest.Stop();
|
||||
if (Physics.Raycast(myRay, out RaycastHit hit))
|
||||
{
|
||||
|
||||
targetDest.transform.position = hit.point;
|
||||
targetDest.Play();
|
||||
player.SetDestination(hit.point);
|
||||
targetDest.Play();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user