Quantcast
Channel: Questions in topic: "dontdestroyonload"
Viewing all articles
Browse latest Browse all 416

How to initiate a counter when the script runs once it increments and once called, increments again?

$
0
0
How to initiate a counter when the script runs once it increments and once called, increments again? using UnityEngine; using System.Collections; public class LoadWorldMapCounter : MonoBehaviour { public static LoadWorldMapCounter Instance; public int LoadMapCount; // Use this for initialization public void Awake() { DontDestroyOnLoad (this); Instance = this; // Not sure where to put or how to use this so that everytime this script runs it adds 1-->LoadMapCount++; } public void Start() { // Not sure where to put or how to use this so that everytime this script runs it adds 1-->LoadMapCount++; } }

Viewing all articles
Browse latest Browse all 416

Trending Articles