public void Environ_Init() { posX = 0; passed = 0; CharacterEntity.GetComponent <HGCharacter>().ResetScore(); while (HGBlock.BlockQueue.Count > 0) { HGObjectPool.GetIns().Depool(HGBlock.BlockQueue.Dequeue()); } while (HGBlock.CoinQueue.Count > 0) { HGObjectPool.GetIns().Depool(HGBlock.CoinQueue.Dequeue()); } GameObject objTemp = HGObjectPool.GetIns().Enpool(HGBlock.getBlock(HGBlockType.Mode_Start) as GameObject); objTemp.GetComponent <Transform>().position = new Vector3(posX++ *width, 0f, 0f); objTemp.transform.SetParent(EnvironEntity.transform); HGBlock.BlockQueue.Enqueue(objTemp); GameObject objTemp2 = HGBlock.getBlock(HGBlockType.Mode_Flypee) as GameObject; while (posX <= 2) { GameObject objTemp1 = HGObjectPool.GetIns().Enpool(objTemp2); objTemp1.GetComponent <Transform>().position = new Vector3(posX++ *width, 0f, 0f); HGBlock.FlypeeSetup(ref objTemp1, blank); objTemp1.transform.SetParent(EnvironEntity.transform); HGBlock.BlockQueue.Enqueue(objTemp1); } }
public void Environ_Update() { passed++; if (passed <= 1) { return; } HGObjectPool.GetIns().Depool(HGBlock.BlockQueue.Dequeue()); GameObject objTemp1 = HGObjectPool.GetIns().Enpool(HGBlock.getBlock(HGBlockType.Mode_Flypee) as GameObject); objTemp1.GetComponent <Transform>().position = new Vector3(posX++ *width, 0f, 0f); HGBlock.FlypeeSetup(ref objTemp1, blank); objTemp1.transform.SetParent(EnvironEntity.transform); HGBlock.BlockQueue.Enqueue(objTemp1); if (passed <= 2) { return; } HGBlock.CoinSetdown(3); }
void HGm_back() { HGBlock.Clear(); HGObjectPool.GetIns().Clear(); SceneManager.LoadScene(0); }