コード例 #1
0
 void SetCurrentSeamModel(BackgroundSwapper.BGType bgType)
 {
     for (int i = 0; i < Seams.Length; i++)
     {
         BGSeamModel model = Seams [i];
         if (model.BGType == bgType)
         {
             _CurrentSeamModel = model;
             break;
         }
     }
 }
コード例 #2
0
    void ChangeBG(BackgroundSwapper bg)
    {
        if (IsChanging)
        {
            BGSeamModel seam = _CurrentSeamModel;

            // get next seam
            int randomRange = Random.Range(0, seam.NextArea.Length);

            BackgroundSwapper.BGType nextSeam = seam.NextArea [randomRange];

            // change top bound content
            bg.CurrentType = nextSeam;

            bg.CurrentBackgroundModel.BGSprite.Init();

            SetCurrentSeamModel(nextSeam);
        }
    }