コード例 #1
0
ファイル: SFXEffectPlay.cs プロジェクト: WeeirJoe/Joe
 public void OnPlayDone(SFXUnit sfx)
 {
     sfxDoneCnt++;
     if (sfx != null && !loop)
     {
         sfx.Hide();
     }
     if (sfxDoneCnt == (played.Count + (audioList.Count == 0 ? 0 : 1)))
     {
         if (loop)
         {
             for (int i = 0; i < played.Count; i++)
             {
                 played[i].RePlay();
             }
             if (audioUpdate)
             {
                 audioUpdate = false;
             }
             if (audioList.Count != 0)
             {
                 audioUpdate = true;
             }
             sfxDoneCnt = 0;
             playedTime = 0.0f;
         }
         else
         {
             for (int i = 0; i < played.Count; i++)
             {
                 Destroy(played[i].gameObject);
             }
             played.Clear();
             if (audioUpdate)
             {
                 audioUpdate = false;
             }
             if (owner == null && tag != "SceneItemAgent")
             {
                 DestroyObject(gameObject);
             }
             else
             {
                 Destroy(this);
             }
         }
     }
 }
コード例 #2
0
 public void OnPlayDone(SFXUnit sfx)
 {
     sfxDoneCnt++;
     if (sfx != null && !loop)
     {
         sfx.Hide();
     }
     if (sfxDoneCnt == (played.Count + (audioList.Count == 0 ? 0 : 1)))
     {
         if (loop)
         {
             for (int i = 0; i < played.Count; i++)
             {
                 played[i].RePlay();
             }
             if (audioPlayCorout != null)
             {
                 StopCoroutine(audioPlayCorout);
             }
             if (audioList.Count != 0)
             {
                 audioPlayCorout = StartCoroutine(PlayAudioEffect());
             }
             sfxDoneCnt = 0;
         }
         else
         {
             for (int i = 0; i < played.Count; i++)
             {
                 Destroy(played[i].gameObject);
             }
             played.Clear();
             Destroy(this);
         }
     }
 }