public static AudioClip GetSoundByName(string _name) { foreach (AudioClip current in SND.soundlist) { if (current.name == _name) { AudioClip result = current; return(result); } } SND.curSound = null; string[] array = _name.Split(new char[] { '/' }); if (array.Length > 1) { SND.curSound = ContentLoader_.LoadAudio(array[array.Length - 1]); } else { SND.curSound = ContentLoader_.LoadAudio(_name); } if (SND.curSound == null) { return(null); } SND.soundlist.Add(SND.curSound); return(SND.curSound); }
private void LoadEnd() { GameObject gameObject = GameObject.Find("Camera"); if (gameObject && gameObject.GetComponent <AudioSource>()) { gameObject.GetComponent <AudioSource>().clip = ContentLoader_.LoadAudio("maintheme"); gameObject.GetComponent <AudioSource>().Play(); gameObject.GetComponent <AudioSource>().volume = Options.menuvol; } Main.tVig = TEX.GetTextureByName("vig"); MonoBehaviour.print("MAIN.LOADEND"); }
public void PostAwake() { HUD.cs = this; this.tBlack = TEX.GetTextureByName("black"); this.tGray0 = TEX.GetTextureByName("gray0"); this.tWhite = TEX.GetTextureByName("white"); this.tYellow = TEX.GetTextureByName("yellow"); this.tHealthIcon = TEX.GetTextureByName("GUI/health_icon"); this.tArmorIcon = TEX.GetTextureByName("GUI/armor_icon"); this.tAmmoIcon = TEX.GetTextureByName("GUI/ammo_icon"); this.tFGIconOrange = TEX.GetTextureByName("GUI/fg_orange"); this.tFGIconGray = TEX.GetTextureByName("GUI/fg_gray"); this.tFGIconWhite = TEX.GetTextureByName("GUI/fg_white"); this.tFBIconOrange = TEX.GetTextureByName("GUI/fb_orange"); this.tFBIconGray = TEX.GetTextureByName("GUI/fb_gray"); this.tFBIconWhite = TEX.GetTextureByName("GUI/fb_white"); this.tSGIconOrange = TEX.GetTextureByName("GUI/sg_orange"); this.tSGIconGray = TEX.GetTextureByName("GUI/sg_gray"); this.tSGIconWhite = TEX.GetTextureByName("GUI/sg_white"); this.tBombIconNormal = TEX.GetTextureByName("GUI/c4_orange"); this.tBombIconActive = TEX.GetTextureByName("GUI/c4_red"); this.tDiffuseIconNormal = TEX.GetTextureByName("GUI/defuse_orange"); this.tDiffuseIconActive = TEX.GetTextureByName("GUI/defuse_red"); this.tGradientLeft = TEX.GetTextureByName("GUI/left_gradient"); this.tGradientRight = TEX.GetTextureByName("GUI/right_gradient"); this.tAmmoIcon = TEX.GetTextureByName("GUI/bullets_icon"); this.tMoneyIcon = TEX.GetTextureByName("GUI/money_icon"); this.tRed = TEX.GetTextureByName("red"); this.tBlue = TEX.GetTextureByName("blue"); this.OnResize(); HUD.sHealth = "-"; HUD.sArmor = "-"; HUD.sMoney = "0"; HUD.Money = 0; HUD.bombState = 0; HUD.diffuseState = 0; HUD.show = false; if (HUD.a == null) { HUD.a = base.gameObject.AddComponent <AudioSource>(); } if (HUD.briefing == null) { HUD.briefing = ContentLoader_.LoadAudio("briefing"); } if (HUD.champion == null) { HUD.champion = ContentLoader_.LoadAudio("champion"); } }