コード例 #1
0
ファイル: GameLogic.cs プロジェクト: snyk04/Gachi-bird
    private void Start()
    {
        serializationManager = SerializationManager.Instance;

        if (serializationManager.CheckIfThisIsFirstStart())
        {
            gameState.IsGameInFirstStartMode = true;
            uI.firstStartInterface.SetActive(true);
        }
        else
        {
            uI.prestartInterface.SetActive(true);
        }
        components.audioPlayer.PlaySound(
            components.audioPlayer.backgroundMusic,
            components.audioPlayer.backgroundSoundAudioSource,
            0.025f,
            true
            );

        components.playerScript.GetComponent <SpriteRenderer>().sprite = sprites.FacesArray[gameState.SkinID];
        components.playerRigidbody.AddForce(transform.right * gamePreferences.gameSpeed, ForceMode2D.Force);

        spawningObjects.DrawBackgroundPart(2);
        spawningObjects.DrawGroundPart(2);
        spawningObjects.BackgroundSpawningCoroutine = StartCoroutine(spawningObjects.DrawBackground(gamePreferences.backgroundSpawningDelay));
        spawningObjects.GroundSpawningCoroutine     = StartCoroutine(spawningObjects.DrawGround(gamePreferences.groundSpawningDelay));
    }