void CheckPowerupAvailability() { // for now, go through the list of unavailable for (int i = 0; i < poolUnavailablePowerUps.Count; i++) { PowerupBase currPu = poolUnavailablePowerUps[i]; if (currPu.IsBackAtSpawner()) { // then the PU needs to go back into the available pool poolUnavailablePowerUps.Remove(currPu); //poolAvailablePowerUps.Add(currPu); } } }
// Update is called once per frame new void LateUpdate() { base.LateUpdate(); if (isFullyInit) { if (_powerup.IsPickedUp() == true || _powerup.IsBackAtSpawner() == true) { mySprite.alpha = 0.0f; } else { mySprite.alpha = this.alphaVisible; } } else { GetPU(); } }
public PowerupBase GetNext() { // pop the next one // TODO: if we have none we have to make one or tell the factory to. PowerupBase nextPU = null; for (int i = 0; i < listOfRootType.Count; i++) { nextPU = listOfRootType[i]; if (nextPU.IsBackAtSpawner()) { return(nextPU); } } // if (listOfRootType.Count > 0){ // System.Predicate<PowerupRoot> puPredicate; // //puPredicate = new System.Predicate<PowerupRoot>(); // nextPU = listOfRootType[0]; // } return(null); }