示例#1
0
 private void DropObject()
 {
     if (myPlayerInfo.active)
     {
         isCarrying = false;
         currentlyCarrying.Drop();
         currentlyCarrying = null;
     }
 }
示例#2
0
 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));
     }
 }
示例#3
0
    private void ResetBlockOOB(GameObject blockOOB)
    {
        InteractableBlock block = blockOOB.GetComponent <InteractableBlock>();

        if (block != null)
        {
            if (block == currentlyCarrying)
            {
                isCarrying = false;
            }
        }
    }
示例#4
0
    private void ResetBlockOOB(GameObject blockOOB)
    {
        InteractableBlock block = blockOOB.GetComponent <InteractableBlock>();

        if (block != null)
        {
            if (block == currentlyTeleported)
            {
                hasTeleported       = false;
                currentlyTeleported = null;
            }
        }
    }
示例#5
0
    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;
                }
            }
        }
    }
示例#6
0
    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;
        }
    }
示例#7
0
    private void TeleportAlternateWorld()
    {
        if (myPlayerInfo.active)
        {
            var closestInteractable = FindClosestInteractable();

            if (closestInteractable != null)
            {
                var interactable = closestInteractable.GetComponent <InteractableBlock>();

                hasTeleported = TeleportObject(interactable);
                if (hasTeleported)
                {
                    currentlyTeleported = interactable;
                }
            }
        }
    }