Example #1
0
        public Transform Play(
            Manager.Sound.Type type,
            string assetBundleName,
            string assetName,
            float delayTime       = 0.0f,
            float fadeTime        = 0.0f,
            bool isAssetEqualPlay = true,
            bool isAsync          = true,
            int settingNo         = -1,
            bool isBundleUnload   = true)
        {
            int       index     = (int)type;
            LoadSound loadSound = (LoadSound) new GameObject("Sound Loading").AddComponent <LoadSound>();

            loadSound.assetBundleName  = assetBundleName;
            loadSound.assetName        = assetName;
            loadSound.type             = type;
            loadSound.delayTime        = delayTime;
            loadSound.fadeTime         = fadeTime;
            loadSound.isAssetEqualPlay = isAssetEqualPlay;
            loadSound.isAsync          = isAsync;
            loadSound.settingNo        = settingNo;
            loadSound.isBundleUnload   = isBundleUnload;
            return(this.SetParent(this.typeObjects[index], (LoadAudioBase)loadSound, this.settingObjects[index]));
        }
Example #2
0
        public void Bind(LoadSound script)
        {
            if (Object.op_Equality((Object)script.audioSource, (Object)null))
            {
                int type = (int)script.type;
                this.SetParent(this.typeObjects[type], (LoadAudioBase)script, this.settingObjects[type]);
            }
            AudioSource audioSource = script.audioSource;

            audioSource.set_clip(script.clip);
            this.Register(script.clip);
            ((Object)audioSource).set_name(((Object)script.clip).get_name());
            Manager.Sound.OutputSettingData outputSettingData = this.AudioSettingData(audioSource, script.settingNo);
            if (outputSettingData == null || (double)script.delayTime > 0.0)
            {
                return;
            }
            script.delayTime = outputSettingData.delayTime;
        }