コード例 #1
0
        public void Start()
        {
            if (colliderVolume == null)
            {
                colliderVolume = GetComponent <Collider>();
            }

            instance = asset.PlayAtPoint(settings, new Vector3(), 1, group, true);
        }
コード例 #2
0
        void OnEnable()
        {
            if (clips != null)
            {
                if (is2D)
                {
                    audioSource = SoundManager.PlayAudio(clips.audioClips, group, volume, looped, Settings);
                }
                else
                {
                    audioSource = SoundManager.PlayAudioAtPoint(clips.audioClips, transform.position, group, volume, looped, Settings);
                }

                if (looped && randomStart && audioSource != null)
                {
                    audioSource.RandomTime();
                }
            }

            if (asset != null)
            {
                if (is2D)
                {
                    instance = asset.Play(Settings, volume, group, looped);
                }
                else
                {
                    instance = asset.PlayAtPoint(Settings, transform.position, volume, group, looped);
                }

                if (looped && randomStart && instance != null)
                {
                    instance.RandomTime();
                }
            }
        }