예제 #1
0
        public void FindAndSetBuildingAreaByAxes(Vector2 aimAxes)
        {
            int     tempCount   = 0;
            Vector3 tempVector3 = MovementTransform.position + (GameplayUtils.GetDirectionByAxes(CacheGameplayCameraTransform, aimAxes.x, aimAxes.y) * ConstructingBuildingEntity.buildDistance);

            switch (CurrentGameInstance.DimensionType)
            {
            case DimensionType.Dimension3D:
                tempCount = PhysicUtils.SortedRaycastNonAlloc3D(tempVector3 + (Vector3.up * 50f), Vector3.down, raycasts, 100f, CurrentGameInstance.GetBuildLayerMask());
                break;

            case DimensionType.Dimension2D:
                tempCount = PhysicUtils.SortedLinecastNonAlloc2D(tempVector3, tempVector3, raycasts2D, CurrentGameInstance.GetBuildLayerMask());
                break;
            }
            LoopSetBuildingArea(tempCount);
        }
예제 #2
0
        public void FindAndSetBuildingAreaByMousePosition()
        {
            int     tempCount = 0;
            Vector3 tempVector3;

            switch (CurrentGameInstance.DimensionType)
            {
            case DimensionType.Dimension3D:
                tempCount = PhysicUtils.SortedRaycastNonAlloc3D(CacheGameplayCameraControls.CacheCamera.ScreenPointToRay(InputManager.MousePosition()), raycasts, 100f, CurrentGameInstance.GetBuildLayerMask());
                break;

            case DimensionType.Dimension2D:
                tempVector3 = CacheGameplayCameraControls.CacheCamera.ScreenToWorldPoint(InputManager.MousePosition());
                tempCount   = PhysicUtils.SortedLinecastNonAlloc2D(tempVector3, tempVector3, raycasts2D, CurrentGameInstance.GetBuildLayerMask());
                break;
            }
            LoopSetBuildingArea(tempCount);
        }