public void ReturnFlipNoteToPool(FlipNote obj) //音符对象回到对象池 { if (obj != null) { flipNotePool.Push(obj); obj.enabled = false; obj.gameObject.SetActive(false); } }
//-------------------------Flip音符对象池方法-------------------------- private void CheckSpawnNextFlipNote() //不断检测是否生成下一个新音符 { int currentTime = DelayedSampleTime; int curNum = 1; while (curNum <= initFlipNotesDatas.Count && initFlipNotesDatas.Peek().dTime <= currentTime) { filpNoteInitData tempData = initFlipNotesDatas.Dequeue(); // Debug.Log("TimeToGo!"); FlipNote newObj = GetFreshFlipNote(); newObj.Initialized(this, tempData.ID, tempData.sPosition, tempData.tPosition, tempData.direction, tempData.nTime, tempData.dTime, tempData.aimDir); curNum++; } }