Esempio n. 1
0
        private object CanBuild(Planner plan, Construction prefab)
        {
            if (prefab.prefabID != 2205372577)
            {
                return(null);
            }
            BasePlayer player = plan.GetOwnerPlayer();

            if (permission.UserHasPermission(player.UserIDString, permissionName))
            {
                return(null);
            }
            RaycastHit[] hits = Physics.RaycastAll(player.eyes.HeadRay(), 5f, collLayers);
            if (!hits.Where(hit => hit.GetEntity() != null).Any(hit => hit.GetEntity().ShortPrefabName.Contains("external")))
            {
                return(null);
            }
            player.ChatMessage(msg("Deny Crusher", player.UserIDString));
            return(false);
        }
Esempio n. 2
0
 public static RaycastHit[] RaycastAll(Ray ray, [DefaultValue("Mathf.Infinity")] float maxDistance, [DefaultValue("DefaultRaycastLayers")] int layerMask)
 {
     return(Physics.RaycastAll(ray.origin, ray.direction, maxDistance, layerMask));
 }
Esempio n. 3
0
        public static RaycastHit[] RaycastAll(Ray ray, float maxDistance)
        {
            int layerMask = -5;

            return(Physics.RaycastAll(ray, maxDistance, layerMask));
        }