public void Bet(ChipValue chipValue) { int value = (int)chipValue; if (value > money) { return; } Money -= value; BetValue += value; BetChipsCount += 1; }
public static GameObject Create(ChipValue value, Vector3 position, bool getValuePrefab = false) { string name = Enum.GetName(typeof(ChipValue), value); if (getValuePrefab) { name += "_Value"; } GameObject chipGameObject = Instantiate(Resources.Load <GameObject>($"Prefabs/Chip_{name}"), position, Quaternion.identity); chipGameObject.transform.SetParent(ChipContainer.ChipParent); return(chipGameObject); }