Advertisement
Guest User

Untitled

a guest
Jun 29th, 2013
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.13 KB | None | 0 0
  1.     void Awake ()
  2.     {
  3.         saveDirPath = Application.dataPath + "/Levels/";
  4.        
  5.         Tools.Assert (buttonSave != null, "buttonSave is not assigned");
  6.         UIEventListener.Get (buttonSave.gameObject).onClick += OnButtonSave_Click;
  7.    
  8.         Tools.Assert (buttonLoad != null, "buttonLoad is not assigned");
  9.         UIEventListener.Get (buttonLoad.gameObject).onClick += OnButtonLoad_Click;
  10.  
  11.         Tools.Assert (buttonInputDialogOk != null, "buttonInputDialogOk is not assigned");
  12.         UIEventListener.Get (buttonInputDialogOk.gameObject).onClick += OnButtonInputDialogOk_Click;
  13.  
  14.         Tools.Assert (buttonInputDialogCancel != null, "buttonImputDialogCancel is not assigned");
  15.         UIEventListener.Get (buttonInputDialogCancel.gameObject).onClick += OnButtonInputDialogCancel_Click;
  16.  
  17.         Tools.Assert (buttonselectLevelDialogClose != null, "buttonselectLevelDialogClose is not assigned");
  18.         UIEventListener.Get (buttonselectLevelDialogClose.gameObject).onClick += OnButtonselectLevelDialogClose_Click;
  19.     }
  20.  
  21. //in Tools class
  22.     public static void Assert (bool condition, string message)
  23.     {
  24. #if UNITY_EDITOR
  25.         if (!condition) {
  26.             throw new UnityException (message);
  27.         }
  28. #endif
  29.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement