Şimdi Ara

Unity High Score problemi

Daha Fazla
Bu Konudaki Kullanıcılar: Daha Az
1 Misafir - 1 Masaüstü
5 sn
4
Cevap
0
Favori
661
Tıklama
Daha Fazla
İstatistik
  • Konu İstatistikleri Yükleniyor
Öne Çıkar
0 oy
Sayfa: 1
Giriş
Mesaj
  • unity'de yaptığım oyunun score manager'ını yaptım fakat high score kısmını gösteremedim. gerekli olan kodu scrptimin içine nasıl koyabilirim bilen varsa yardımcı olabilir mi?? bu işte daha beginner sayılırım pek bi bilgim yok google ve unity'de tutoriallara baktım bir sürü script denedim ama olmadı.

    ScoreManager Script:

    using UnityEngine; 
    using UnityEngine.UI;
    using System.Collections;

    public class ScoreManager : MonoBehaviour
    {
    public static int score; // The player's score.


    Text text; // Reference to the Text component.


    void Awake ()
    {
    // Set up the reference.
    text = GetComponent <Text> ();

    // Reset the score.
    score = 0;
    }


    void Update ()
    {
    // Set the displayed text to be the word "Score" followed by the score value.
    text.text = "Score: " + score;

    }

    }



    _____________________________




  • Degişken kaydetmek için PlayerPrefs kullanmalısın

    http://docs.unity3d.com/ScriptReference/PlayerPrefs.html
    _____________________________
  • kullandım ama sonuç değişmedi
    _____________________________
  • Yanlış kavramışşın böyle kullanıcaksın

    if(skor>yuksekskor){ 
    PlayerPrefs.SetInt(yuksekskor, skor);
    PlayerPrefs.Save();
    }


    Mantık çok basit senin skor degişkenin son halini yuksekskor olarak kaydediyorsun. Ayrıca bu hatanın çözümünü "Unity Saving Variables" diye aratsan direk bulabilirsin detaylı olarak ingilizceni geliştirmeni tavsiye ederim



    < Bu mesaj bu kişi tarafından değiştirildi Guest-E94B9CA23 -- 23 Ekim 2015; 2:29:34 >
    _____________________________
  • Yapay Zeka’dan İlgili Konular
    Daha Fazla Göster
    
Sayfa: 1
- x
Bildirim
mesajınız kopyalandı (ctrl+v) yapıştırmak istediğiniz yere yapıştırabilirsiniz.