aeroson

Untitled

Nov 27th, 2017
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1.  
  2. class ZZZ {
  3.  
  4. void Method() {
  5.  
  6. GameObject go = ...
  7.  
  8. switch(go.name) {
  9. case "XX":
  10. case "YY":
  11. case "ZZ":
  12. CreaterPopup(go.name ...
  13. break;
  14. default:
  15. break;
  16. }
  17. }
  18.  
  19. }
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31. class ZZZ {
  32.  
  33. HashSet<string> allowedGoNames = new HashSet<string>() { "XX", "YY", "ZZ" };
  34.  
  35. void Method() {
  36.  
  37. GameObject go = ...
  38.  
  39. if(allowedGoNames.Contains(go.name))
  40. CreaterPopup(go.name ...
  41.  
  42. }
  43.  
  44. }
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61. class ZZZ {
  62.  
  63. string[] allowedGoNames = new string[] { "XX", "YY", "ZZ" };
  64.  
  65. void Method() {
  66.  
  67. GameObject go = ...
  68.  
  69. if(allowedGoNames.IndexOf(go.name) != -1)
  70. CreaterPopup(go.name ...
  71.  
  72. }
  73.  
  74. }
Advertisement
Add Comment
Please, Sign In to add comment