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); } }
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)); } } }
public void Start() { this.setPowered(Electricity.checkPower(base.transform.position, 8f)); }