示例#1
0
 public void setState(bool setState)
 {
     this.state = setState;
     this.setPowered(Electricity.checkPower(base.transform.position, 8f));
     if (!this.powered || !this.state)
     {
         this.setLights(false);
     }
     else
     {
         this.setLights(true);
     }
 }
示例#2
0
 public static void applyPower(Vector3 position, float range)
 {
     Collider[] colliderArray = Physics.OverlapSphere(position, range, 32768);
     for (int i = 0; i < (int)colliderArray.Length; i++)
     {
         if (colliderArray[i].transform.parent.name == "16002")
         {
             colliderArray[i].GetComponent <Lamp>().setPowered(Electricity.checkPower(colliderArray[i].transform.position, 8f));
         }
         else if (colliderArray[i].transform.parent.name == "16009" || colliderArray[i].transform.parent.name == "16021")
         {
             colliderArray[i].GetComponent <ElectricTrap>().setPowered(Electricity.checkPower(colliderArray[i].transform.position, 8f));
         }
     }
 }
示例#3
0
 public void Start()
 {
     this.setPowered(Electricity.checkPower(base.transform.position, 8f));
 }