public override void Execute() { if (!IsExecuted) { progressBar = GameObject.Instantiate(CrewController.Instance.progressBarPrefab, crewMember.progressBarSlot.transform); IsExecuted = true; } crewMember.ExtinguishFire(); var fire = crewMember.CurrentCommand.Destination.Hazards.FirstOrDefault(x => x.HazardType == HazardType.Fire); if (fire == null) { GameObject.Destroy(progressBar.gameObject); IsFinished = true; return; } progressBar.SetProgressDone(fire.SeverityAmount); }