コード例 #1
0
 // Token: 0x06003469 RID: 13417 RVA: 0x001572F0 File Offset: 0x001556F0
 public static bool checkFires(Vector3 point, float radius)
 {
     PowerTool.firesInRadius.Clear();
     PowerTool.checkInteractables <InteractableFire>(point, radius, ushort.MaxValue, PowerTool.firesInRadius);
     for (int i = 0; i < PowerTool.firesInRadius.Count; i++)
     {
         if (PowerTool.firesInRadius[i].isLit)
         {
             return(true);
         }
     }
     PowerTool.ovensInRadius.Clear();
     PowerTool.checkInteractables <InteractableOven>(point, radius, ushort.MaxValue, PowerTool.ovensInRadius);
     for (int j = 0; j < PowerTool.ovensInRadius.Count; j++)
     {
         if (PowerTool.ovensInRadius[j].isWired && PowerTool.ovensInRadius[j].isLit)
         {
             return(true);
         }
     }
     return(false);
 }
コード例 #2
0
 // Token: 0x0600346B RID: 13419 RVA: 0x001573CB File Offset: 0x001557CB
 public static List <InteractablePower> checkPower(Vector3 point, float radius, ushort plant)
 {
     PowerTool.powerInRadius.Clear();
     PowerTool.checkInteractables <InteractablePower>(point, radius, plant, PowerTool.powerInRadius);
     return(PowerTool.powerInRadius);
 }
コード例 #3
0
 public override void tick()
 {
     if (base.channel.isOwner)
     {
         if ((base.transform.position - this.chargePoint).sqrMagnitude > 1f)
         {
             this.chargePoint = base.transform.position;
             this.foundInRadius.Clear();
             PowerTool.checkInteractables <InteractableCharge>(this.chargePoint, 64f, this.foundInRadius);
             for (int i = this.chargesInRadius.Count - 1; i >= 0; i--)
             {
                 InteractableCharge interactableCharge = this.chargesInRadius[i];
                 if (interactableCharge == null)
                 {
                     this.chargesInRadius.RemoveAtFast(i);
                 }
                 else if (!this.foundInRadius.Contains(interactableCharge))
                 {
                     interactableCharge.unhighlight();
                     this.chargesInRadius.RemoveAtFast(i);
                 }
             }
             for (int j = 0; j < this.foundInRadius.Count; j++)
             {
                 InteractableCharge interactableCharge2 = this.foundInRadius[j];
                 if (!(interactableCharge2 == null))
                 {
                     if (interactableCharge2.hasOwnership)
                     {
                         if (!this.chargesInRadius.Contains(interactableCharge2))
                         {
                             interactableCharge2.highlight();
                             this.chargesInRadius.Add(interactableCharge2);
                         }
                     }
                 }
             }
         }
         InteractableCharge interactableCharge3 = null;
         float num = 0.98f;
         for (int k = 0; k < this.chargesInRadius.Count; k++)
         {
             InteractableCharge interactableCharge4 = this.chargesInRadius[k];
             if (!(interactableCharge4 == null))
             {
                 float num2 = Vector3.Dot((interactableCharge4.transform.position - MainCamera.instance.transform.position).normalized, MainCamera.instance.transform.forward);
                 if (num2 > num)
                 {
                     interactableCharge3 = interactableCharge4;
                     num = num2;
                 }
             }
         }
         if (interactableCharge3 != this.target)
         {
             if (this.target != null)
             {
                 this.target.untarget();
             }
             this.target = interactableCharge3;
             if (this.target != null)
             {
                 this.target.target();
             }
         }
     }
 }