Unity coin system?
hallo, ich möchte ein Punktesystem erstellen, bei dem der Float bestimmt, wie viel der int als Pickup-Beispiel aufnimmt: float = 1, dann der Player Pickup 1
float = 20, dann nimmt der Spieler 20 auf, dass der Float die int (Pickup-Nummer) bestimmt
Vielen Dank im Voraus
1 Antwort
Vom Beitragsersteller als hilfreich ausgezeichnet
Von gutefrage auf Grund seines Wissens auf einem Fachgebiet ausgezeichneter Nutzer
programmieren, Unity
pickUp += Mathf.RoundToInt(float);
https://docs.unity3d.com/2017.1/Documentation/ScriptReference/Mathf.RoundToInt.html
Je nach gewünschtem Runden der gehen hier auch Alternativen wie CeilToInt usw.
Woher ich das weiß:Berufserfahrung