private void Start() { SimulationEvents.On("SimulationSuccess", SetInteractiveStateOff); SimulationEvents.On("SimulationFailed", SetInteractiveStateOff); interactiveText = interactiveTextObject.GetComponent <Text>(); _canInteract = true; }
void UnsubscribeTimer() { SimulationEvents.Unsubscribe(EventType.SimulationStarted, timer.StartTimer); SimulationEvents.Unsubscribe(EventType.SimulationFailed, timer.StopTimer); SimulationEvents.Unsubscribe(EventType.SimulationSuccess, timer.StopTimer); timer.ClearEvents(); }
void Start() { agent = GetComponent <NavMeshAgent>(); SimulationEvents.On(EventType.SimulationStarted, AllowMovement); SimulationEvents.On(EventType.SimulationFailed, ProhibitMovement); SimulationEvents.On(EventType.SimulationSuccess, ProhibitMovement); }
void Start() { LockCursor(); SimulationEvents.On(EventType.SimulationStarted, AllowLook); SimulationEvents.On(EventType.SimulationFailed, ProhibitLook); SimulationEvents.On(EventType.SimulationSuccess, ProhibitLook); }
void InitTimer() { float failTime = SimulationSession.Current.FAIL_TIME; timer = gameObject.AddComponent <Timer>(); timer.ResetTimer(); timer.On(failTime, () => { // TODO move to checklist SetTask() and add validation errors.Add($"No completo la simulacion en el tiempo adecuado de {failTime.ToString()} segundos"); SimulationEvents.Emit(EventType.SimulationFailed); }); SimulationEvents.On(EventType.SimulationStarted, timer.StartTimer); SimulationEvents.On(EventType.SimulationFailed, timer.StopTimer); SimulationEvents.On(EventType.SimulationSuccess, timer.StopTimer); }
void InitChecklistAndValidator() { checklist = ChecklistFactory.Get(SimulationSession.Current.simulationMode); validator = ChecklistFactory.GetValidator(SimulationSession.Current.simulationMode, checklist); validator.onError += (err) => errors.Add(err); validator.onPass += (TaskType t, bool compl) => checklist.SetTaskCompletion(t, compl); validator.onFail += () => { SimulationEvents.Emit(EventType.SimulationFailed); simulationComplete = false; }; validator.onSuccess += () => { SimulationEvents.Emit(EventType.SimulationSuccess); simulationComplete = true; }; }
void UnsubscribeValidator() { if (validator == null) { return; } validator.onError -= (err) => errors.Add(err); validator.onFail -= () => { simulationComplete = false; SimulationEvents.Emit(EventType.SimulationFailed); }; validator.onSuccess -= () => { simulationComplete = true; SimulationEvents.Emit(EventType.SimulationSuccess); }; }
void OnDestroy() { SimulationEvents.Unsubscribe("SimulationSuccess", SetInteractiveStateOff); SimulationEvents.Unsubscribe("SumulationFailed", SetInteractiveStateOff); }
void UnsubscribeToEvents() { SimulationAttempt.Checklist.OnTaskChanged.RemoveListener(CheckAnimationConditions); SimulationEvents.Unsubscribe(EventType.SimulationFailed, StopOperations); }
void Start() { SimulationEvents.On(EventType.SimulationStarted, AllowMovement); SimulationEvents.On(EventType.SimulationFailed, ProhibitMovement); SimulationEvents.On(EventType.SimulationSuccess, ProhibitMovement); }
void OnDestroy() { SimulationEvents.Unsubscribe(EventType.SimulationStarted, AllowMovement); SimulationEvents.Unsubscribe(EventType.SimulationFailed, ProhibitMovement); SimulationEvents.Unsubscribe(EventType.SimulationSuccess, ProhibitMovement); }
void OnDestroy() { SimulationEvents.Unsubscribe(EventType.SimulationSuccess, SimulationSuccess); SimulationEvents.Unsubscribe(EventType.SimulationFailed, SimulationFailed); }
void Start() { SimulationEvents.On(EventType.SimulationSuccess, SimulationSuccess); SimulationEvents.On(EventType.SimulationFailed, SimulationFailed); }
public void EmitEvent(EventType e) { SimulationEvents.Emit(e); }