Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ZZZ {
- void Method() {
- GameObject go = ...
- switch(go.name) {
- case "XX":
- case "YY":
- case "ZZ":
- CreaterPopup(go.name ...
- break;
- default:
- break;
- }
- }
- }
- class ZZZ {
- HashSet<string> allowedGoNames = new HashSet<string>() { "XX", "YY", "ZZ" };
- void Method() {
- GameObject go = ...
- if(allowedGoNames.Contains(go.name))
- CreaterPopup(go.name ...
- }
- }
- class ZZZ {
- string[] allowedGoNames = new string[] { "XX", "YY", "ZZ" };
- void Method() {
- GameObject go = ...
- if(allowedGoNames.IndexOf(go.name) != -1)
- CreaterPopup(go.name ...
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment