コード例 #1
0
    public static AudioObject Create(AudioClip clip, int clip_id, float volume, bool loop, AudioMixerGroup mixer_group, AudioControlGroup controlGroup, bool is3DSound = false, DisableNotifyMonoBehaviour master = null, Transform parent = null, Vector3?initPos = default(Vector3?))
    {
        //IL_0065: Unknown result type (might be due to invalid IL or missing references)
        //IL_006f: Unknown result type (might be due to invalid IL or missing references)
        if (clip == null)
        {
            return(null);
        }
        AudioObject audioObject = AudioObjectPool.Borrow();

        if (!(audioObject == null))
        {
            goto IL_0020;
        }
        goto IL_0020;
IL_0020:
        audioObject._transform.set_parent(MonoBehaviourSingleton <SoundManager> .I._transform);
        audioObject.m_masterGroup    = controlGroup;
        audioObject.m_IsSpatialSound = is3DSound;
        if (initPos.HasValue)
        {
            audioObject._transform.set_position((!initPos.HasValue) ? Vector3.get_zero() : initPos.Value);
            audioObject.m_IsStaticPosition = true;
        }
        audioObject.Play(clip, clip_id, volume, loop, mixer_group, master, parent);
        return(audioObject);
    }
コード例 #2
0
 public static void StopAudioObjectAll()
 {
     if (MonoBehaviourSingleton <AudioObjectPool> .IsValid())
     {
         AudioObjectPool.StopAll();
     }
 }
コード例 #3
0
 void InitAudioManager()
 {
     AudioPool = new AudioObjectPool();
     AudioPool.Init();
     this.BackGroundMusicVolume = 0.1f;
     this.SoundEffectsVolume    = 1.0f;
 }
コード例 #4
0
 public override void Skip()
 {
     //IL_003d: Unknown result type (might be due to invalid IL or missing references)
     if (!skip && !IsFinishDrop10() && !m_isAlreadySkipped)
     {
         m_isAlreadySkipped = true;
         AudioObjectPool.StopAllLentObjects();
         base.Skip();
         this.StartCoroutine(DoSkip());
     }
 }
コード例 #5
0
 private void Dispose()
 {
     InitParams();
     if (audioSource != null)
     {
         audioSource.Stop();
         InitAudioSource();
     }
     if (m_masterGroup != null)
     {
         m_masterGroup.NotifyOnStop(this);
         m_masterGroup = null;
     }
     AudioObjectPool.Release(this);
 }
コード例 #6
0
    void Start()
    {
        aop            = GameObject.FindGameObjectWithTag("AudioObjPool").GetComponent <AudioObjectPool>();
        shroomMR       = GetComponent <MeshRenderer>();
        myShroomShader = shroomMR.material;

        float randomScale = Random.Range(0.75f, 1.5f);

        transform.localScale *= randomScale;

        originalSize = transform.localScale;

        largeSize = originalSize * 2;

        float randomRotate = Random.Range(0, 360);

        transform.Rotate(0, randomRotate, 0);

        rhythm = Random.Range(1, 5);

        breatheDistance = 15;
    }