private IEnumerator DelayPlaySE(SELabel seLabel, float delay)
    {
        yield return(new WaitForSeconds(delay));

        AudioSource se = seSourceList[nextSESourceNum];

        se.PlayOneShot(seClipDic[seLabel.ToString()]);
        nextSESourceNum = (++nextSESourceNum < SE_SOURCE_NUM) ? nextSESourceNum : 0;
    }
Exemple #2
0
        public static void Init()
        {
            score     = 0;
            highScore = SerializationSystem.GetValue <int>("highScore.json");

            isBirdFly     = false;
            isGameWaiting = true;

            highScoreLabel = new SELabel(SEResourcesManager.GetFontByName("PixelFontScore"));
            highScoreLabel.GetComponent().GetFontComponent().SetText(highScore.ToString());
            highScoreLabel.GetComponent().GetTransformComponent().SetPosition(SEProperties.GetGameWindowWidth() / 2, SEProperties.GetGameWindowHeight() / 8);

            scoreLabel = new SELabel(SEResourcesManager.GetFontByName("PixelFontScore"));
            scoreLabel.GetComponent().GetFontComponent().SetText(score.ToString());
            scoreLabel.GetComponent().GetTransformComponent().SetPosition(SEProperties.GetGameWindowWidth() / 2, SEProperties.GetGameWindowHeight() / 20);

            textLabel = new SELabel(SEResourcesManager.GetFontByName("PixelFontText"));
            textLabel.GetComponent().GetFontComponent().SetText("Tap on space to play game");
            textLabel.GetComponent().GetTransformComponent().SetPosition(150, 400);

            groundHeigth = 450;
        }
 /// <summary>
 /// 指定したファイル名のSEを流す。第二引数のdelayに指定した時間だけ再生までの間隔を空ける
 /// </summary>
 /// /// <param name="seLabel"></param>
 /// /// <param name="delay"></param>
 public void PlaySE(SELabel seLabel, float delay = 0.0f)
 {
     StartCoroutine(DelayPlaySE(seLabel, delay));
 }