235 case Function.TURN_OFF_HIGHLIGHT_OBJECT:
236 Debug.Log($
"case Function.TurnOffHighlightObject {stepItem.stepID}");
239 case Function.ACTIVATE_AND_HIGHLIGHT:
240 Debug.Log($
"case Function.ActivateAndHighlight {stepItem.stepID}");
242 if (StatesService.GetState<ScenarioState>().IsEvaluation)
244 ExecuteFunction(
new ActivateAndHighlightOnSelection(), stepItem, stepFunction);
252 case Function.DEACTIVATE_AND_HIGHLIGHT_OFF:
253 Debug.Log($
"case Function.DeactivateAndHighlightOff {stepItem.stepID}");
254 ExecuteFunction(
new DeactivateAndHighlightOff(), stepItem, stepFunction);
256 case Function.PLAY_VOICE_OVER:
257 Debug.Log($
"case Function.PlayVoiceOver {stepItem.stepID}");
261 case Function.GRABLE_OR_INTERACT_OBJECT:
262 Debug.Log($
"case Function.GrableOrInteractObject {stepItem.stepID}");
266 case Function.TELEPORT_TO_POSITION:
267 Debug.Log($
"case Function.TeleportToPosition {stepItem.stepID}");
271 case Function.TRANSIT_TO_SCENE:
272 Debug.Log($
"case Function.TransitToScene {stepItem.stepID}");
276 case Function.START_PLAY_ANIMATION:
277 Debug.Log($
"case Function:StartPlayAnimation {stepItem.stepID}");
281 case Function.START_REVERSE_ANIMATION:
282 Debug.Log($
"case Function:StartReverseAnimation {stepItem.stepID}");
286 case Function.OPEN_INSPECTION_MENU_FOR_ITEM:
287 Debug.Log($
"case Function:OpenInspectionMenuForItem {stepItem.stepID}");
288 ExecuteFunction(
new OpenInspectionMenuForItem(), stepItem, stepFunction);
291 case Function.SET_ADDITIONAL_PARAMS_FOR_ITEM:
292 Debug.Log($
"case Function:SetAdditionalParamsForItem {stepItem.stepID}");
293 ExecuteFunction(
new SetAdditionalParamsForItem(), stepItem, stepFunction);
296 case Function.PREPARE_INSPECTION_REPORT:
297 Debug.Log($
"case Function:PrepareInspectionReport {stepItem.stepID}");
298 ExecuteFunction(
new PrepareInspectionReport(), stepItem, stepFunction);
301 case Function.SHOW_MODEL:
302 Debug.Log($
"case Function.SHOW_MODEL {stepItem.stepID}");
306 case Function.HIDE_MODEL:
307 Debug.Log($
"case Function.HIDE_MODEL {stepItem.stepID}");
311 case Function.GENERATE_BREAKDOWN:
312 Debug.Log($
"case Function:GenerateBreakdown {stepItem.stepID}");
320 case Function.SET_DEFAULT_STATE:
321 Debug.Log($
"case Function:SetDefaultStateForItem {stepItem.stepID}");
325 case Function.TURN_ON_OBJECTS:
326 Debug.Log($
"case Function.ActivateObject {stepItem.stepID}");
330 case Function.TURN_OFF_OBJECTS:
331 Debug.Log($
"case Function.DeactivateObject {stepItem.stepID}");
335 case Function.WAITING_FOR_CHOICE:
336 Debug.Log($
"case Function.WaitingForChoice {stepItem.stepID}");
341 case Function.HIGHLIGHT_ON_SELECTION:
342 Debug.Log($
"case Function.HighlightOnSelection {stepItem.stepID}");
347 Debug.Log($
"case Function.Delay {stepItem.stepID}");
351 case Function.SET_VOICE_OVER_VOLUME:
352 Debug.Log($
"case Function.SetVoiceOverVolume {stepItem.stepID}");
356 case Function.SET_FX_VOLUME:
357 Debug.Log($
"case Function.Delay {stepItem.stepID}");
361 case Function.CHECK_ALREADY_INSPECTION:
362 Debug.Log($
"case Function.CheckAlreadyInspection {stepItem.stepID}");
366 case Function.SET_TIMER:
367 Debug.Log($
"case Function.SET_TIMER {stepItem.stepID}");
371 case Function.STOP_TIMER:
372 Debug.Log($
"case Function.STOP_TIMER {stepItem.stepID}");
386 private void ExecuteFunction(IStep step, StepItem stepItem, StepFunction
function)
388 List<InteractableClass> listGameObjects =
new List<InteractableClass>();
390 bool isWaitForDone =
function.waitForDone;
392 foreach (var item
in function.itemsForAction)
411 step.OnFunctionFinished += () =>
414 "incremented temp " + temp +
" tempStepID: " + tempStepID
426 else if (stepItem.waitForUserAction && stepItem.nextSteps.Count != 0)
431 step.StartStep(stepItem,
function, listGameObjects, () => { isWaitForDone =
false; });
438 if (isWaitForDone && !stepItem.waitForUserAction)
440 step.OnFunctionFinished += () =>
446 else if (!stepItem.waitForUserAction)
460 private void RegisterItems(ItemsEnum item, InteractableClass interactableClass)
462 Debug.Log(
"Registered item : X" + (
int)item +
" " + item.ToString(), interactableClass.gameObject);
473 Debug.Log(
"RegisterClickOnItems item : " + item);
477 Debug.LogWarning(
"Register items is exist");
495 var
stepId = stepItem.nextSteps[items.IndexOf(item)];
501 var
stepId = stepItem.nextSteps[0];
507 if (stepItem.voiceOverIDWrongAction !=
string.Empty
508 && !(itemsID.Any(s => s == item.ToString())))
522 bool isChoiceGood =
false;
524 if (presentedItem !=
null)
528 for (
int i = 1; i < items.Count; i++)
533 var
stepId = stepItem.nextSteps[i - 1];
543 if (stepItem.voiceOverIDWrongAction !=
string.Empty)
548 else if (!isChoiceGood && presentedItem !=
null &&
function.value != String.Empty)
550 var voiceOvers =
function.value.Split(
new char[] {
'#' });
552 if (voiceOvers.Length < items.Count)
554 Debug.Log(
"You don't have enough parameters, the first one will be used for all!");
557 for (
int i = 0; i < items.Count; i++)
566 if (item == ItemsEnum.SKIP_STEP)
568 var
stepId = stepItem.nextSteps[0];
578 var guideModeState = StatesService.GetState<GuideModeState>();
580 if (!guideModeState.IsModeActive)
582 if (!voiceOverData.isGuided)
590 new GuideVoiceOverPlayEvent()