public override void OnEvent(RemoveWater evnt) { if (evnt.Entity) { WaterSource[] componentsInChildren = evnt.Entity.GetComponentsInChildren <WaterSource>(true); if (componentsInChildren.Length > 0) { componentsInChildren[0].RemoveWater(evnt.Amount); } } }
public void RemoveWater(float amount) { if (BoltNetwork.isClient && this._entityCache && this._entityCache.isAttached) { RemoveWater removeWater = global::RemoveWater.Create(GlobalTargets.OnlyServer); removeWater.Amount = amount; removeWater.Entity = this._entityCache; removeWater.Send(); } else { this.AmountReal = Mathf.Max(this.AmountReal - amount, 0f); } this.ToggleIcons(base.enabled); base.SendMessage("UpdateWater", SendMessageOptions.DontRequireReceiver); }
public override void OnEvent(RemoveWater evnt) { if (evnt.Entity) { WaterSource[] componentsInChildren = evnt.Entity.GetComponentsInChildren<WaterSource>(true); if (componentsInChildren.Length > 0) { componentsInChildren[0].RemoveWater(evnt.Amount); } } }