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();
 }
예제 #3
0
 void Start()
 {
     agent = GetComponent <NavMeshAgent>();
     SimulationEvents.On(EventType.SimulationStarted, AllowMovement);
     SimulationEvents.On(EventType.SimulationFailed, ProhibitMovement);
     SimulationEvents.On(EventType.SimulationSuccess, ProhibitMovement);
 }
예제 #4
0
 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);
 }
예제 #10
0
 void Start()
 {
     SimulationEvents.On(EventType.SimulationStarted, AllowMovement);
     SimulationEvents.On(EventType.SimulationFailed, ProhibitMovement);
     SimulationEvents.On(EventType.SimulationSuccess, ProhibitMovement);
 }
예제 #11
0
 void OnDestroy()
 {
     SimulationEvents.Unsubscribe(EventType.SimulationStarted, AllowMovement);
     SimulationEvents.Unsubscribe(EventType.SimulationFailed, ProhibitMovement);
     SimulationEvents.Unsubscribe(EventType.SimulationSuccess, ProhibitMovement);
 }
예제 #12
0
 void OnDestroy()
 {
     SimulationEvents.Unsubscribe(EventType.SimulationSuccess, SimulationSuccess);
     SimulationEvents.Unsubscribe(EventType.SimulationFailed, SimulationFailed);
 }
예제 #13
0
 void Start()
 {
     SimulationEvents.On(EventType.SimulationSuccess, SimulationSuccess);
     SimulationEvents.On(EventType.SimulationFailed, SimulationFailed);
 }
예제 #14
0
 public void EmitEvent(EventType e)
 {
     SimulationEvents.Emit(e);
 }