Ejemplo n.º 1
0
    /// <summary>
    /// Interact with a door at the specified position if there is a closed door there.
    /// </summary>
    /// <param name="currentPos">current world position </param>
    /// <param name="targetPos">position to interact with</param>
    private void InteractDoor(Vector3Int currentPos, Vector3Int targetPos)
    {
        // Make sure there is a door which can be interacted with
        DoorTrigger door = MatrixManager.GetClosedDoorAt(currentPos, targetPos);

        // Attempt to open door
        if (door != null)
        {
            door.Interact(gameObject, TransformState.HiddenPos);
        }
    }