c# - PlayerPrefs.SetInt and .GetInt having undesired effect -


I have an app in Unity 3D which I'm making for Android, and you collect coins which coins Can Play Every time I start the game, my coin amount starts up to 0, even then I am using SetInt and the next time a player plays the game, I try to save the coin.

Completely unsure why this coin is not saving money, no idea? (Maybe some stupid because I'm a little bit of a knot)

  using UnityEngine; Using System.Collections; Public category pickup coin: Monobehavik {public interest amount; Public audio clip Sikkim; Public audioSOS playerAudio; Zero Start () (If PlayerPrefs.GetInt ("TotalCoinsPlayerPrefs") == Faucet) {PlayerPrefs.SetInt ("TotalCoinsPlayerPrefs", 0);} AmountOfCoins = PlayerPrefs.GetInt ("TotalCoinsPlayerPrefs");} Zero OnCollisionEnter (other collision) {if (other gameObject.name.Contains ("coin")) {playerAudio.PlayOneShot (Sikkating); amountOfCoins + = 1; Player Prefs.SetInt ("TotalCoinsPlayerPrefs", ZodiacApocax); Debug ("Quantity of coins Is: "+ quantoffics"). Debug ("player prefix coin amount" + Player profiles.gateInt ("TotalComplayerPRFS"). Toasting ();; deleted (other.gameOb ject);}}   

}

To verify that PlayerPref is "incorrect" to verify existence ( PlayerPrefs.GetInt ("TotalCoinsPlayerPrefs") == blank ). The right way to do that function is to invite the function. < p> Actually, I think your current test always gives TRUE, and the content of your PlayerPref is always started as a game in 0 is started.

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -