public void OnInteract(bool isHeldDown) { if (IsCarryingObject()) { if (m_PickedUpObject.isThrowable && !isHeldDown) { ThrowCarryingObject(); } else { PutDownCarryingObject(); } return; } if (IsGrabbingObject()) { StopGrabbingObject(m_GrabbedObject); return; } InteractableBase usableInteractable = FindUsableInteractable(); if (usableInteractable == null) { return; } usableInteractable.OnInteract(m_Character); }
public void OnInteract() { if (MovableOBJ != null) { DetatchMovableObject(); return; } if (LiftedUpOBJ != null) { LiftedUpOBJ.GetComponent <InteractablePickUp>().Throw(Character.m_MovementModel.GetFacingDirection()); Character.m_MovementModel.ThrowLiftedObject(); LiftedUpOBJ = null; return; } InteractableBase usableInteractable = FindUsableInteractable(); if (usableInteractable == null) { return; } if (!usableInteractable.enabled) { return; } if (!usableInteractable.isActiveAndEnabled) { return; } //Debug.Log("Found Interactable! " + usableInteractable.name); usableInteractable.OnInteract(); }
private void UpdateAction() { if (Input.GetKeyDown(KeyCode.D)) { if (menuView.GetMenuActive() == true) { TitleScreenView.Instance.ActionPresed(); } InteractableBase interactableBase = playerStats.GetInteractableBase(); if (DialogueTextUI.Instance.GetDialogueBoxActive() == true) { interactableBase.GetComponent <DialogueBase>().DoSpeech(); return; } if (interactableBase != null) { interactableBase.OnInteract(); } else { OnAttackPressed(); } } }
public void OnInteract() { InteractableBase interactable = FindUsableInteractable(); if (null != interactable) { interactable.OnInteract(); } }
public void OnInteract() { InteractableBase usableInteractable = FindUsableInteracable(); if (usableInteractable == null) { return; } usableInteractable.OnInteract(m_Character); // Debug.Log("Found InteractableBase: " + usableInteractable.name); }
public override void DoAction() { InteractableBase interactableInProximity = FindInteractableInProximity(); if (interactableInProximity == null) { DoAttack(); return; } interactableInProximity.OnInteract(); }
public void OnInteract() { if (IsCarryingObject() == true) { ThrowCarryingObject(); return; } if (Interactable != null) { Interactable.OnInteract(m_Character); m_IsCloseEnoughToInteract = false; } }
public void OnInteract() { if (IsCarryingObject()) { ThrowCarryingObject(); } InteractableBase usableInteractable = FindUsableInteractable(); if (usableInteractable == null) { return; } usableInteractable.OnInteract(m_Character); }
//Do interact public void OnInteract() { if (IsCarryingObject() == true) //If the player is currently carrying an object { ThrowCarryingObject(); //Throw it return; } InteractableBase usableInteractable = FindUsableInteractable(); //Find an object in range that the user can interact with if (usableInteractable == null) { return; //No interactable found } usableInteractable.OnInteract(m_Character); //Do the interact }
public void OnInteract() { if (m_MovementModel.getIsCarrying() == true) { ThrowCarryingObject(false); return; } InteractableBase usableInteractable = FindUsableInteractable(); if (usableInteractable == null) { return; } usableInteractable.OnInteract(m_Character); }
// OnStateExit is called when a transition ends and the state machine finishes evaluating this state override public void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { InteractableBase interactable = targetGameObject.GetComponent <InteractableBase>(); interactable.OnInteract(); }