Example #1
0
 internal Enumerator(ref ExplosionHelper.Point point, bool immediate)
 {
     this._immediate = immediate;
     this.IN = point;
     this.colliderIndex = -1;
     this.inInstanceEnumerator = false;
     this.overlapEnumerator = null;
     this.output = null;
     this.overlap = null;
     this.current = new ExplosionHelper.Surface();
 }
Example #2
0
 public void Dispose()
 {
     this.colliderIndex = -1;
     if (this.inInstanceEnumerator)
     {
         this.inInstanceEnumerator = false;
         this.overlapEnumerator.Dispose();
     }
     this.overlapEnumerator = null;
     this.output = null;
     this.overlap = null;
     this.current = new ExplosionHelper.Surface();
 }
Example #3
0
 public bool MoveNext()
 {
     Label_007D:
     while (this.inInstanceEnumerator)
     {
         if ((this._immediate || (this.output != null)) && this.overlapEnumerator.MoveNext())
         {
             MeshBatchInstance current = this.overlapEnumerator.Current;
             if (this.IN.SurfaceForMeshBatchInstance(current, ref this.current))
             {
                 return true;
             }
         }
         else
         {
             this.overlapEnumerator.Dispose();
             this.overlapEnumerator = null;
             this.inInstanceEnumerator = false;
             this.output = null;
         }
     }
     if (this.colliderIndex++ == -1)
     {
         this.overlap = Physics.OverlapSphere(this.IN.point, this.IN.blastRadius, this.IN.overlapLayerMask);
     }
     while (this.colliderIndex < this.overlap.Length)
     {
         if (this._immediate || (this.overlap[this.colliderIndex] != null))
         {
             if (this.overlap[this.colliderIndex].GetMeshBatchPhysicalOutput<MeshBatchPhysicalOutput>(out this.output))
             {
                 this.inInstanceEnumerator = true;
                 this.overlapEnumerator = this.output.EnumerateOverlapSphereInstances(this.IN.point, this.IN.blastRadius).GetEnumerator();
                 goto Label_007D;
             }
             if (this.IN.SurfaceForCollider(this.overlap[this.colliderIndex], ref this.current))
             {
                 return true;
             }
         }
         this.colliderIndex++;
     }
     this.colliderIndex = this.overlap.Length;
     this.current = new ExplosionHelper.Surface();
     return false;
 }