private void Awake() { if (Instance != null && Instance != this) { // destroy the duplicate Destroy(gameObject); } else { Instance = this; } }
public void Initialize() { if (useDebug) { Debug.Log("CALLED ---> ProcessPanel::Initialize()"); } processTime = Random.Range(5, 25); startTime = Time.time; timeFromLastAddedBar = 0; deltaBarTime = processTime / 20.0f; processID = processCounter++; progressManager = ProgressMenuManager.Instance; progressManager.AddProcess(processID); StartCoroutine("StartProcess"); }