Exemple #1
0
 public static bool CanPlayerUseWires(BasePlayer player)
 {
     if (!player.CanBuild())
     {
         return(false);
     }
     return(!GamePhysics.CheckSphere(player.eyes.position, 0.1f, 536870912, QueryTriggerInteraction.Collide));
 }
Exemple #2
0
 public override bool DoCheck(Construction.Placement place)
 {
     if (this.wantsCollide == GamePhysics.CheckSphere(Vector3.op_Addition(place.position, Quaternion.op_Multiply(place.rotation, this.worldPosition)), this.sphereRadius, ((LayerMask) ref this.layerMask).get_value(), (QueryTriggerInteraction)0))
     {
         return(true);
     }
     Construction.lastPlacementError = "Failed Check: Sphere Test (" + this.hierachyName + ")";
     return(false);
 }
    public override bool DoCheck(Construction.Placement place)
    {
        Vector3 vector3 = place.position + (place.rotation * this.worldPosition);

        if (this.wantsCollide == GamePhysics.CheckSphere(vector3, this.sphereRadius, this.layerMask.@value, QueryTriggerInteraction.UseGlobal))
        {
            return(true);
        }
        Construction.lastPlacementError = string.Concat("Failed Check: Sphere Test (", this.hierachyName, ")");
        return(false);
    }
Exemple #4
0
    public static bool CheckSphere(Vector3 pos, float radius, int layerMask, ColliderInfo.Flags ignore)
    {
        if ((int)ignore == 0)
        {
            return(GamePhysics.CheckSphere(pos, radius, layerMask, QueryTriggerInteraction.UseGlobal));
        }
        List <Collider> list = Pool.GetList <Collider>();

        GamePhysics.OverlapSphere(pos, radius, list, layerMask, QueryTriggerInteraction.Ignore);
        bool flag = DeployVolume.CheckFlags(list, ignore);

        Pool.FreeList <Collider>(ref list);
        return(flag);
    }
    public static bool CheckSphere(
        Vector3 pos,
        float radius,
        int layerMask,
        ColliderInfo.Flags ignore)
    {
        if (ignore == (ColliderInfo.Flags) 0)
        {
            return(GamePhysics.CheckSphere(pos, radius, layerMask, (QueryTriggerInteraction)0));
        }
        List <Collider> list = (List <Collider>)Pool.GetList <Collider>();

        GamePhysics.OverlapSphere(pos, radius, list, layerMask, (QueryTriggerInteraction)1);
        int num = DeployVolume.CheckFlags(list, ignore) ? 1 : 0;

        // ISSUE: cast to a reference type
        Pool.FreeList <Collider>((List <M0>&) ref list);
        return(num != 0);
    }
Exemple #6
0
 public bool GetIgnore(Vector3 pos, float radius = 0.01f)
 {
     return(GamePhysics.CheckSphere <WaterVisibilityTrigger>(pos, radius, 262144, QueryTriggerInteraction.Collide));
 }
Exemple #7
0
 public bool GetIgnore(Vector3 pos, float radius = 0.01f)
 {
     return(GamePhysics.CheckSphere <TerrainCollisionTrigger>(pos, radius, 262144, (QueryTriggerInteraction)2));
 }