private void DropObject() { if (myPlayerInfo.active) { isCarrying = false; currentlyCarrying.Drop(); currentlyCarrying = null; } }
private bool TeleportObject(InteractableBlock teleportObj) { if (teleportObj.currentWorld == DataTypes.World.WorldOne) { return(teleportObj.Teleport(DataTypes.World.WorldTwo, DataTypes.worldTwoY)); } else { return(teleportObj.Teleport(DataTypes.World.WorldOne, DataTypes.worldOneY)); } }
private void ResetBlockOOB(GameObject blockOOB) { InteractableBlock block = blockOOB.GetComponent <InteractableBlock>(); if (block != null) { if (block == currentlyCarrying) { isCarrying = false; } } }
private void ResetBlockOOB(GameObject blockOOB) { InteractableBlock block = blockOOB.GetComponent <InteractableBlock>(); if (block != null) { if (block == currentlyTeleported) { hasTeleported = false; currentlyTeleported = null; } } }
private void PickupObject() { if (myPlayerInfo.active) { var closestInteractable = FindClosestInteractable(); if (closestInteractable != null) { var interactable = closestInteractable.GetComponent <InteractableBlock>(); if (interactable.PickUp(carryLocation)) { isCarrying = true; currentlyCarrying = interactable; } } } }
private void OnTriggerEnter2D(Collider2D collision) { PlayerMovement player = collision.gameObject.GetComponent <PlayerMovement>(); if (player != null) { EventManager.instance.playerOutOfBounds.Invoke(player.playerNumber); return; } InteractableBlock block = collision.gameObject.GetComponent <InteractableBlock>(); if (block != null) { EventManager.instance.blockOutOfBounds.Invoke(collision.gameObject); return; } }
private void TeleportAlternateWorld() { if (myPlayerInfo.active) { var closestInteractable = FindClosestInteractable(); if (closestInteractable != null) { var interactable = closestInteractable.GetComponent <InteractableBlock>(); hasTeleported = TeleportObject(interactable); if (hasTeleported) { currentlyTeleported = interactable; } } } }