계산대 로직 중간저장
This commit is contained in:
28
Assets/02_Scripts/Data/Player/PlayerWallet.cs
Normal file
28
Assets/02_Scripts/Data/Player/PlayerWallet.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace VRShopping.Player
|
||||
{
|
||||
public class PlayerWallet : MonoBehaviour
|
||||
{
|
||||
//예산
|
||||
[Min(0)] public int Budget;
|
||||
|
||||
public bool PayMoney(int cost)
|
||||
{
|
||||
bool successFlag;
|
||||
|
||||
//예산이 비용보다 많을시
|
||||
if(Budget >= cost)
|
||||
{
|
||||
Budget -= cost;
|
||||
successFlag = true;
|
||||
}
|
||||
else //예산 부족
|
||||
{
|
||||
successFlag = false;
|
||||
}
|
||||
|
||||
return successFlag;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user