コード例 #1
0
ファイル: Train.cs プロジェクト: LudumHub/LD42-Guns-n-Carrots
    private IEnumerator MoveToNextWagon()
    {
        Analytics.CompleteLevel(levelsCompleted++, time);
        time = 0;
        ProtectionWall.SetActive(true);

        UnregisterCurrentWagon();
        UpdateDpsLabel();
        shouldUpdateDps = false;
        yield return(currentWagon.Destroy());

        TUTURU.Play();
        RegisterNextWagon();
        shouldUpdateDps = true;

        var currentY = transform.position.y;

        foreach (var y in Easing.OutSine(currentY, currentY - wagonLength, 2))
        {
            var position = transform.position;
            position.y         = y;
            transform.position = position;
            yield return(new WaitForEndOfFrame());
        }

        ProtectionWall.SetActive(false);
    }