//Get level from our level factory and add it //to the top of the buffer. public void LoadNewLevel() { obj = levelFactory.GetPooledObject(); if (obj != null) { top = levelBuffer.topOfBuffer(); obj.SetActive(true); obj.transform.position = top.GetComponent <Level>().GetTransoform().position; obj.transform.position += temp; levelBuffer.Enqueue(obj); Debug.Log("active level count is " + levelBuffer.BufferCount()); } }
//Get level from our level factory and add it //to the top of the buffer. public void LoadNewLevel() { finishedLevels = levelFactory.GetPooledObject(); if (finishedLevels != null) { top = levelBuffer.topOfBuffer(); finishedLevels.SetActive(true); finishedLevels.transform.position = top.GetComponent <Level>().GetTransoform().position; finishedLevels.transform.position += temp; finishedLevels.GetComponent <Level>().setSheetPosition(); finishedLevels.GetComponent <Level>().getSkelRef().GetComponent <skeleton>().setObsticalPositions(); levelBuffer.Enqueue(finishedLevels); //Debug.Log("active level count is " + levelBuffer.BufferCount()); } }