Exemple #1
0
        private bool IsSessionDataReady()
        {
            bool isReady = (_path != null && _pathSegments != null && _startObject != null && _pathExtensionPlane != null);

            if (!isReady)
            {
                return(false);
            }

            if (_heightAdjustmentSettings.HeightAdjustmentMode == ObjectPlacementPathHeightAdjustmentMode.AutomaticPattern &&
                ObjectPlacementPathHeightPatternDatabase.Get().ActivePattern == null)
            {
                Debug.LogWarning("Can not begin path construction because the automatic pattern height adjustment mode is selected but there is no active pattern.");
                isReady = false;
            }

            if (_tileConnectionSettings.UseTileConnections && !_tileConnectionSettings.DoAllTileConnectionsHavePrefabAssociated(true))
            {
                Debug.LogWarning("You are using tile connections, but not all tiles have an associated prefab. Please associate a prefab with each tile in order to being path construction.");
                isReady = false;
            }

            OrientedBox hierarchyWorldOrientedBox = _startObject.GetHierarchyWorldOrientedBox();
            float       absSizeRight = hierarchyWorldOrientedBox.GetRotatedAndScaledSizeAlongDirection(_pathExtensionPlane.RightAxis);
            float       absSizeLook  = hierarchyWorldOrientedBox.GetRotatedAndScaledSizeAlongDirection(_pathExtensionPlane.LookAxis);

            if (absSizeRight < 1e-4f || absSizeLook < 1e-4f)
            {
                Debug.LogWarning("Can not begin path construction because the object has a 0 size component along the extention plane axes.");
                isReady = false;
            }

            return(isReady);
        }
Exemple #2
0
        private bool IsSessionDataReady()
        {
            bool isReady = (_block != null && _blockSegments != null && _startObject != null && _blockExtensionPlane != null);

            if (!isReady)
            {
                return(false);
            }

            OrientedBox hierarchyWorldOrientedBox = _startObject.GetHierarchyWorldOrientedBox();
            float       absSizeRight = hierarchyWorldOrientedBox.GetRotatedAndScaledSizeAlongDirection(_blockExtensionPlane.RightAxis);
            float       absSizeLook  = hierarchyWorldOrientedBox.GetRotatedAndScaledSizeAlongDirection(_blockExtensionPlane.LookAxis);

            if (absSizeRight < 1e-4f || absSizeLook < 1e-4f)
            {
                Debug.LogWarning("Can not begin block construction because the object has a 0 size component along the extention plane axes.");
                isReady = false;
            }

            return(isReady);
        }