Advertisement
Draco18s

This is Stupid

Feb 22nd, 2021
1,248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.61 KB | None | 0 0
  1. public class Manager : Broadcaster
  2. {
  3.     public Group[] discrepancies;
  4.  
  5.     public override void OnInitialize() {
  6.         Listen(Data.enterBroadcast, Enable);
  7.         Listen(Data.exitBroadcast, Disable);
  8.     }
  9.  
  10.     private void Enable(ListenResult result) {
  11.         Data d = (Data)result.Value;
  12.         d.DoEnable.Enabled.Value = true;
  13.     }
  14.  
  15.     private void Disable(ListenResult result) {
  16.         // result.value is always null on exit :V
  17.         // Data d = (Data)result.Value;
  18.         // d.FaultID.DoEnable.Value = false;
  19.         foreach(Group group in discrepancies) {
  20.             foreach(Helper helper in group.Properties) {
  21.                 helper.Enabled.Value = false;
  22.             }
  23.         }
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement