private void Start() { if (SceneManager.GetActiveScene().name == "Classic") { op = GameObject.FindObjectOfType <ObjectPool>(); } else if (SceneManager.GetActiveScene().name == "Boost") { bop = GameObject.FindObjectOfType <BoostObjectPool>(); } else if (SceneManager.GetActiveScene().name == "Hoop") { hop = GameObject.FindObjectOfType <HoopObjectPool>(); } else if (SceneManager.GetActiveScene().name == "Protect") { pop = GameObject.FindObjectOfType <ProtectObjectPool>(); } else if (SceneManager.GetActiveScene().name == "Gap") { gop = GameObject.FindObjectOfType <GapObjectPool>(); } }
// Use this for initialization void Start() { isStarted = false; ball = GameObject.Find("Ball"); //Place the object pool relative to the gamemode manually, no need to fill in the rest if (op == null) { op = null; } if (gop == null) { gop = null; } if (hop == null) { hop = null; } if (pop == null) { pop = null; } if (bop == null) { bop = null; } }
void Awake() { if (op == null) { op = null; } else if (bop == null) { bop = null; } else if (hop == null) { hop = null; } else if (pop == null) { pop = null; } else if (gop == null) { gop = null; } }