Beispiel #1
0
 private void OnLevelWasLoaded(int level)
 {
     StopAllCoroutines();
     waitingForCallback = false;
     InputManager.Instance.PlayerMovementEnabled = true;
     InputManager.Instance.CameraControlEnabled = true;
     _examinableObject = null;
     ForceDisengage();
     interactives.Clear();
 }
Beispiel #2
0
        void ExamineInput()
        {
            if (waitingForCallback) return;
            if (_examinableObject == null) return;
            if (_examineCoolingDown) return;

            if (interactives.Count > 1) GuiManager.Instance.DrawCycleInput();
            if (Input.GetKeyDown(KeyCode.R))
            {
                var index = interactives.IndexOf(_examinableObject);
                if (index <= -1 || index >= interactives.Count - 1)
                {
                    index = -1;
                }
                _examinableObject = interactives[index + 1];
            }
            
            if (InputManager.Instance.InteractAction)
            {
                ExamineObject();
            }
        }
Beispiel #3
0
 public void OnInteractionTriggerExit(Collider other)
 {
     CleanOutNullInteractives();
     var component = other.GetComponent<MonoBehaviour>();
     //If we are exiting an examinable set the current examinable to null
     if (component as ExaminableBase != null && interactives.IndexOf(component as ExaminableBase) != -1)
     {
         interactives.Remove(component as ExaminableBase);
         _examinableObject = interactives.Count == 0 ? null : interactives[0];
     }
 }
Beispiel #4
0
 public void OnInteractionTriggerEnter(Collider other)
 {
     CleanOutNullInteractives();
     var component = other.GetComponent<MonoBehaviour>();
     //If we are entering an examinable set the current examinable to it
     if (component as ExaminableBase != null)
     {
         if (interactives.Count == 0 && interactives.IndexOf(component as ExaminableBase) == -1)
         {
             _examinableObject = component as ExaminableBase;
         }
         interactives.Add(component as ExaminableBase);
     }
 }