コード例 #1
0
 public static bool ApplyWaterChecks(
     this Transform transform,
     WaterCheck[] anchors,
     Vector3 pos,
     Quaternion rot,
     Vector3 scale)
 {
     if (anchors.Length == 0)
     {
         return(true);
     }
     for (int index = 0; index < anchors.Length; ++index)
     {
         WaterCheck anchor  = anchors[index];
         Vector3    vector3 = Vector3.Scale(anchor.worldPosition, scale);
         if (anchor.Rotate)
         {
             vector3 = Quaternion.op_Multiply(rot, vector3);
         }
         if (!anchor.Check(Vector3.op_Addition(pos, vector3)))
         {
             return(false);
         }
     }
     return(true);
 }
コード例 #2
0
 public static bool ApplyWaterChecks(this Transform transform, WaterCheck[] anchors, Vector3 pos, Quaternion rot, Vector3 scale)
 {
     if (anchors.Length == 0)
     {
         return(true);
     }
     for (int i = 0; i < (int)anchors.Length; i++)
     {
         WaterCheck waterCheck = anchors[i];
         Vector3    vector3    = Vector3.Scale(waterCheck.worldPosition, scale);
         if (waterCheck.Rotate)
         {
             vector3 = rot * vector3;
         }
         if (!waterCheck.Check(pos + vector3))
         {
             return(false);
         }
     }
     return(true);
 }