Пример #1
0
        private CoverPoint CalculateCoverPoint(NavMeshHit info)
        {
            RaycastHit rayHit;

            CoverPointVolume.CoverType coverType = this.ProvidesCoverInDir(new Ray(((NavMeshHit) ref info).get_position(), Vector3.op_UnaryNegation(((NavMeshHit) ref info).get_normal())), this.CoverPointRayLength, out rayHit);
            if (coverType == CoverPointVolume.CoverType.None)
            {
                return((CoverPoint)null);
            }
            CoverPoint coverPoint = new CoverPoint(this, this.DefaultCoverPointScore)
            {
                Position = ((NavMeshHit) ref info).get_position(),
                Normal   = Vector3.op_UnaryNegation(((NavMeshHit) ref info).get_normal())
            };

            if (coverType == CoverPointVolume.CoverType.Full)
            {
                coverPoint.NormalCoverType = CoverPoint.CoverType.Full;
            }
            else if (coverType == CoverPointVolume.CoverType.Partial)
            {
                coverPoint.NormalCoverType = CoverPoint.CoverType.Partial;
            }
            return(coverPoint);
        }
Пример #2
0
        private CoverPoint CalculateCoverPoint(NavMeshHit info)
        {
            RaycastHit raycastHit;

            CoverPointVolume.CoverType coverType = this.ProvidesCoverInDir(new Ray(info.position, -info.normal), this.CoverPointRayLength, out raycastHit);
            if (coverType == CoverPointVolume.CoverType.None)
            {
                return(null);
            }
            CoverPoint coverPoint = new CoverPoint(this, this.DefaultCoverPointScore)
            {
                Position = info.position,
                Normal   = -info.normal
            };

            if (coverType == CoverPointVolume.CoverType.Full)
            {
                coverPoint.NormalCoverType = CoverPoint.CoverType.Full;
            }
            else if (coverType == CoverPointVolume.CoverType.Partial)
            {
                coverPoint.NormalCoverType = CoverPoint.CoverType.Partial;
            }
            return(coverPoint);
        }