void Awake() { if (instance != null) { Debug.Log("more than 1 manager"); } instance = this; }
// Start is called before the first frame update void Start() { groundCount = 0; drop = false; gPParent = GPManager.instance; gPSon = gPParent.guineaPigs; destination = transform.position; current = 0; }
void Awake() { if (instance != null) { throw new System.Exception("You have more than 1 GPManager in the scene."); } // Initialize the static class variables instance = this; DontDestroyOnLoad(gameObject); }
// Start is called before the first frame update void Start() { int index = SceneManager.GetActiveScene().buildIndex; speed = index * 0.5f; onFire = false; addOffset = new Vector3(0, 0 + yAxisOffset, 0); currentDirection = right; nextPos = Vector3.right; dirIndex = 1; destination = transform.position; manager = GPManager.instance; turnPos = new Queue <Vector3>(); turnDir = new Queue <bool>(); }
private void Awake() { if (Instance == null) { Instance = this; } else { Destroy(this); } if (this) { Load(); } }
// Use this for initialization void Awake() { if (singleton == null) { singleton = this; } else if (singleton != this) { Destroy(gameObject); return; } canvases = FindObjectOfType <Canvases>(); BeginAuthorize(); }