예제 #1
0
        public override void Execute()
        {
            if (!IsExecuted)
            {
                progressBar = GameObject.Instantiate(CrewController.Instance.progressBarPrefab, crewMember.progressBarSlot.transform);
                IsExecuted  = true;
            }

            crewMember.FixHullBreach();

            var fire = crewMember.CurrentCommand.Destination.Hazards.FirstOrDefault(x => x.HazardType == HazardType.Breach);

            if (fire == null)
            {
                GameObject.Destroy(progressBar.gameObject);
                IsFinished = true;
                return;
            }

            progressBar.SetProgressDone(fire.SeverityAmount);
        }