Пример #1
0
    private void Start()
    {
        Player              = GameObject.FindGameObjectWithTag("Player");
        CoinsCollected      = CoinScript.GetScore();
        EasterEggsCollected = EasterEggs_Script.GetEasterEggs();
        UnusedBones         = Player.GetComponent <ThrowBoneScript>().GetNumberOfBones();
        LifesSaved          = NeoHealthSystemScript.GetNumberOfCurrentLifes();

        TimeInGame       = MovementScript.TimeSpentInGame;
        PickedCoins.text = $"Coins: {CoinsCollected}";
        LeftBones.text   = $"Left bones: {UnusedBones}";

        PickedEasterEggs.text = $"Easter eggs: {EasterEggsCollected}";
        LeftLifes.text        = $"Lifes: {LifesSaved}";
        KilledDinosaurus.text = $"Kills: {DeathDinosaurus}";
        Timer.text            = $"Time: {TimeInGame}";
    }
Пример #2
0
    public void SaveData()
    {
        int CurrentScore = CoinScript.GetScore();
        //int CurrentBones = PlayerThrow.GetNumberOfBones();
        //Debug.Log($"Bones: {CurrentBones}");
        int   CurrentEggs   = EasterEggs_Script.GetEasterEggs();
        int   CurrentHealth = NeoHealthSystemScript.GetNumberOfCurrentLifes();
        float Timer         = Player.GetComponent <MovementScript>().GetTime();

        //Debug.Log($"Current Health : {CurrentHealth}");
        PlayerPrefs.SetInt("Score", CurrentScore);
        //PlayerPrefs.SetInt("Bones", CurrentBones);
        PlayerPrefs.SetInt("Health", CurrentHealth);
        PlayerPrefs.SetInt("Eggs", CurrentEggs);
        PlayerPrefs.SetFloat("Timer", Timer);
        PlayerPrefs.Save();
    }
Пример #3
0
 void Update()
 {
     ScoreText.text = $"    {CoinScript.GetScore()}";
     BoneText.text  = $"{Bones.GetNumberOfBones()}";
     TimeText.text  = $"Time: {Player.GetComponent<MovementScript>().GetTime()}";
 }