|
Hello. I have a very simple question. I have a game with 2 maps. On the 2 maps you can destroy objects with a gun ... but when I change the map I want to have again 0 Kills on the Point Counter. Now if I change the level the kills remain saved. How can I make that if I change level Point Count = 0 ? Here are my scripts:
and the 2nd script is:
I NEED VERY FAST HELP! Thank you in advance for every answer :)
(comments are locked)
|
|
if(Application.Loadlevel(1)) { Points = 0; } that may work
(comments are locked)
|
|
It's in the nature of static vars that it won't reset, but I'll save that speech for another time. The easiest way is just to reset it as soon as the object loads. using UnityEngine; using System.Collections; public class PointCounter : MonoBehaviour { public GUISkin guiSkin = null; public static int points = 0; } Thank you for the fast answer. I will try it out tomorrow (in 14 hours) and I hope this will work. other answers are welcome :)
Oct 08 '11 at 08:48 PM
worldofcars
(comments are locked)
|
