Ejemplo n.º 1
0
        public bool IsCharacterInsideScene(ParcelScene scene)
        {
            bool result = false;

            if (scene.IsInsideSceneBoundaries(DCLCharacterController.i.characterPosition))
            {
                result = true;
            }

            return(result);
        }
    private void Update()
    {
        if (!isEditModeActivated)
        {
            return;
        }

        if (Time.timeSinceLevelLoad >= nexTimeToReceiveInput)
        {
            if (Utils.isCursorLocked || isAdvancedModeActive)
            {
                CheckEditModeInput();
            }
            if (currentActiveMode != null)
            {
                currentActiveMode.CheckInput();
            }
        }

        if (checkerInsideSceneOptimizationCounter >= 60)
        {
            if (!sceneToEdit.IsInsideSceneBoundaries(DCLCharacterController.i.characterPosition))
            {
                ExitEditMode();
            }
            checkerInsideSceneOptimizationCounter = 0;
        }
        else
        {
            checkerInsideSceneOptimizationCounter++;
        }

        if (checkerSceneLimitsOptimizationCounter >= 10)
        {
            checkerSceneLimitsOptimizationCounter = 0;
            CheckPublishConditions();
        }
        else
        {
            checkerSceneLimitsOptimizationCounter++;
        }
    }
Ejemplo n.º 3
0
    private void Update()
    {
        if (!isBuilderInWorldActivated)
        {
            return;
        }

        if (checkerInsideSceneOptimizationCounter >= 60)
        {
            if (!sceneToEdit.IsInsideSceneBoundaries(DCLCharacterController.i.characterPosition))
            {
                ExitEditMode();
            }
            checkerInsideSceneOptimizationCounter = 0;
        }
        else
        {
            checkerInsideSceneOptimizationCounter++;
        }
    }
Ejemplo n.º 4
0
    bool IsVoxelAtValidPoint(VoxelPrefab voxelPrefab, List <DCLBuilderInWorldEntity> entitiesToCheck)
    {
        if (!currentScene.IsInsideSceneBoundaries(voxelPrefab.meshRenderer.bounds))
        {
            return(false);
        }
        Bounds bounds = voxelPrefab.meshRenderer.bounds;

        bounds.size -= Vector3.one * VOXEL_BOUND_ERROR;
        foreach (DCLBuilderInWorldEntity entity in entitiesToCheck)
        {
            if (entity.rootEntity.meshesInfo == null || entity.rootEntity.meshesInfo.renderers == null)
            {
                continue;
            }
            if (bounds.Intersects(entity.rootEntity.meshesInfo.mergedBounds))
            {
                return(false);
            }
        }
        bounds.size += Vector3.one * VOXEL_BOUND_ERROR;
        return(true);
    }
Ejemplo n.º 5
0
 public bool IsCharacterInsideScene(ParcelScene scene)
 {
     return(scene.IsInsideSceneBoundaries(DCLCharacterController.i.characterPosition));
 }