Ejemplo n.º 1
0
    public int PlaySE_Ex(string path)
    {
        int num = -1;

        for (int i = 0; i < this.audioSEList.Count; i++)
        {
            if (!this.audioSEList[i].ads.isPlaying)
            {
                num = i;
                break;
            }
        }
        if (num == -1)
        {
            global::Debug.LogError("CAN NOT PLAY SE");
        }
        else
        {
            AudioClip clip     = this.LoadAudio(path);
            SoundCtr  soundCtr = this.audioSEList[num];
            soundCtr.value      = 0f;
            soundCtr.seName     = path;
            soundCtr.autoDel    = true;
            soundCtr.time       = 0f;
            soundCtr.act        = null;
            soundCtr.ads.clip   = clip;
            soundCtr.ads.loop   = false;
            soundCtr.ads.pitch  = 1f;
            soundCtr.selfVolume = -1;
            soundCtr.Play(true);
        }
        return(num);
    }
Ejemplo n.º 2
0
    public void PlayTimeScaleSE(string path, float time = 0f, bool loop = false, bool isAutoDel = true, Action <int> act = null, int selfVolume = -1)
    {
        AudioClip clip = this.LoadAudio(path);
        int       i;

        for (i = this.SE_MAX; i < this.audioSEList.Count; i++)
        {
            if (this.audioSEList[i].seName == string.Empty)
            {
                break;
            }
        }
        if (i < this.SE_MAX || i >= this.audioSEList.Count)
        {
            global::Debug.LogWarning("<color=red>======================SoundMng::PlaySE ファイル </color>" + path + "<color=red> SE OVER</color>");
            return;
        }
        SoundCtr soundCtr = this.audioSEList[i];

        soundCtr.value      = 0f;
        soundCtr.seName     = path;
        soundCtr.autoDel    = isAutoDel;
        soundCtr.time       = time;
        soundCtr.act        = act;
        soundCtr.ads.clip   = clip;
        soundCtr.ads.loop   = loop;
        soundCtr.ads.pitch  = 1f;
        soundCtr.selfVolume = selfVolume;
        soundCtr.Play(true);
    }
Ejemplo n.º 3
0
 public void StopAllSE(float time = 0f)
 {
     for (int i = 0; i < this.audioSEList.Count; i++)
     {
         if (this.audioSEList[i].seName != string.Empty)
         {
             SoundCtr soundCtr = this.audioSEList[i];
             soundCtr.time = time;
             soundCtr.act  = null;
             soundCtr.Play(false);
         }
     }
 }
Ejemplo n.º 4
0
    public void StopSE(string path, float time = 0f, Action <int> act = null)
    {
        int i;

        for (i = 0; i < this.audioSEList.Count; i++)
        {
            if (this.audioSEList[i].seName == path)
            {
                break;
            }
        }
        if (i == this.audioSEList.Count)
        {
            global::Debug.Log("======================SoundMng::PlaySE 番号 " + path + " NOT PLAYING SE");
            return;
        }
        SoundCtr soundCtr = this.audioSEList[i];

        soundCtr.time = time;
        soundCtr.act  = act;
        soundCtr.Play(false);
    }