コード例 #1
0
    void SpawnPlatform()
    {
        MovingPlatform platform = _movingPlatformProvider.GetRandomPlatform();

        ResetPlatform(platform);

        platform.gameObject.SetActive(true);

        if (!_highScoreSurpassed && _spawnedPlatformsCount == _highScoreController.HighScore) // About to surpass current high score
        {
            platform.ChangeMaterial(_platformHighScoreMaterial);
            _highScoreSurpassed = true;
        }

        _spawnedPlatformsCount++;
    }
コード例 #2
0
 void ResetPlatform(MovingPlatform platform)
 {
     platform.transform.SetPositionAndRotation(_initialPlatformPosition.position, Quaternion.identity);
     platform.ChangeMaterial(_platformDefaultMaterial);
 }