//Yeah could be moved into a switch and then a shift call could be made to move onto the next step... IEnumerator ProcessSpaqnRequest(Artillery _Requestee) { CurrentRequestee = _Requestee; CurrentStatus = ASMStatus.SearchingForDropZone; ScanForDropZone(); yield return(new WaitUntil(() => CurrentRequestee.CurrentSpawnStatus == ArtillerySpawnStatus.GunDropPointFound)); if (DropPointLocation != null && DropPointLocationSpawnCentre != null) { CurrentStatus = ASMStatus.SpawningGun; DropInGun(_Requestee); yield return(new WaitUntil(() => CurrentRequestee.CurrentSpawnStatus == ArtillerySpawnStatus.GunLanded)); } if (CurrentRequestee.CurrentSpawnStatus == ArtillerySpawnStatus.GunLanded) { CurrentStatus = ASMStatus.SpawningCrew; DropInGunCrew(_Requestee); yield return(new WaitUntil(() => CurrentRequestee.CurrentSpawnStatus == ArtillerySpawnStatus.CrewLanded)); } if (CheckSpawnIsCompleate()) { CurrentStatus = ASMStatus.CleaningUp; CurrentRequestee.CurrentSpawnStatus = ArtillerySpawnStatus.Ready; ResetSpawner(); } }
// void ResetSpawner() { CurrentRequestee = null; DropPointLocation = null; DropPointLocationSpawnCentre = null; CrewMemberSpawnLocations = null; CurrentStatus = ASMStatus.Inactive; }