41 lines
884 B
C#
41 lines
884 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
|
|
public class PlayerInfo : MonoBehaviour
|
|
{
|
|
public static PlayerInfo instance;
|
|
|
|
public float Money = 1000;
|
|
public float AllBetCoins;//总共下注蛋
|
|
public TextMeshProUGUI SelfWoniuText;//蜗牛下注显示文本
|
|
public bool HaveBet;//是否已经下注过
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
instance = this;
|
|
EggNum.instance.eggNumText.text=Money.ToString();
|
|
}
|
|
|
|
public bool SetMoney(float add)
|
|
{
|
|
if (Money+add>=0)
|
|
{
|
|
float start = Money;
|
|
Money += add;
|
|
EggNum.instance.SetEggNumText(start);
|
|
return true;
|
|
}
|
|
Debug.Log("钱不够");
|
|
return false;
|
|
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
}
|