StructureType









How do I use Structure Type
Below are practical examples compiled from projects for learning and reference purposes

Featured Snippets


File name: Structure.cs Copy
13  public enum StructureType{
14   Wood,
15   Stone,
16   Glass
17  }
File name: Structure.cs Copy
101  void AudioManager(){
102   switch (structure) {
103   case StructureType.Wood:
104    if(GameController.instance != null && MusicController.instance != null){
105     if(GameController.instance.isMusicOn){
106      if (gameObject != null) {
107       AudioSource.PlayClipAtPoint (woodSound, transform.position);
108      }
109     }
110    }
111    break;
112
113   case StructureType.Stone:
114    if(GameController.instance != null && MusicController.instance != null){
115     if(GameController.instance.isMusicOn){
116      if (gameObject != null) {
117       AudioSource.PlayClipAtPoint (stoneSound, transform.position);
118      }
119     }
120    }
121    break;
122
123   case StructureType.Glass:
124    if(GameController.instance != null && MusicController.instance != null){
125     if(GameController.instance.isMusicOn){
126      if (gameObject != null) {
127       AudioSource.PlayClipAtPoint (glassSound, transform.position);
128      }
129     }
130    }
131    break;
132   }
133  }

StructureType 116 lượt xem

Gõ tìm kiếm nhanh...