Esempio n. 1
0
        private void LoadSetting(Manager.Sound.Type type, int settingNo = -1)
        {
            string          self            = type.ToString();
            AssetBundleData assetBundleData = new AssetBundleData("sound/setting/object/00.unity3d", self.ToLower());
            GameObject      gameObject      = (GameObject)Object.Instantiate <GameObject>((M0)assetBundleData.GetAsset <GameObject>(), this.rootSetting, false);

            ((Object)gameObject).set_name(self + "_Setting");
            this.AudioSettingData((AudioSource)gameObject.GetComponent <AudioSource>(), settingNo);
            if (self.CompareParts("gamese", true))
            {
                ;
            }
            this.settingObjects[(int)type] = gameObject;
            assetBundleData.UnloadBundle(true, false);
        }
Esempio n. 2
0
 protected override void Awake()
 {
     if (!this.CheckInstance())
     {
         return;
     }
     Object.DontDestroyOnLoad((Object)((Component)this).get_gameObject());
     Manager.Sound.Mixer = new AssetBundleData("sound/data/mixer/00.unity3d", "master").GetAsset <AudioMixer>();
     this.rootSetting    = new GameObject("SettingObject").get_transform();
     this.rootSetting.SetParent(((Component)this).get_transform(), false);
     this.rootPlay = new GameObject("PlayObject").get_transform();
     this.rootPlay.SetParent(((Component)this).get_transform(), false);
     this.LoadSettingData();
     this.settingObjects = new GameObject[Illusion.Utils.Enum <Manager.Sound.Type> .Length];
     this.typeObjects    = new Transform[this.settingObjects.Length];
     for (int index = 0; index < this.settingObjects.Length; ++index)
     {
         Manager.Sound.Type type = (Manager.Sound.Type)index;
         this.LoadSetting(type, -1);
         Transform transform = new GameObject(type.ToString()).get_transform();
         transform.SetParent(this.rootPlay, false);
         this.typeObjects[index] = transform;
     }
     this.dicASCache  = new Dictionary <int, Dictionary <string, AudioSource> >();
     this.ASCacheRoot = new GameObject("AudioSourceCache").get_transform();
     this.ASCacheRoot.SetParent(this.rootPlay, false);
     this.listener = new GameObject("Listener", new System.Type[1]
     {
         typeof(AudioListener)
     }).get_transform();
     this.listener.SetParent(((Component)this).get_transform(), false);
     if (!Object.op_Inequality((Object)Camera.get_main(), (Object)null))
     {
         return;
     }
     this._listener = ((Component)Camera.get_main()).get_transform();
 }