Esempio n. 1
0
    public void points()
    {
        Scors scors = HIghScors.load();

        for (int i = 0; i < 10; i++)
        {
            text[i].text = (i + 1) + ": " + scors.hs[i];
        }
    }
Esempio n. 2
0
    public static void SaveScore(enemy enemy)
    {
        BinaryFormatter format = new BinaryFormatter();
        string          path   = Application.persistentDataPath + "/score.score";
        FileStream      stream = new FileStream(path, FileMode.Create);

        Scors scors = new Scors(enemy);

        format.Serialize(stream, scors);
        stream.Close();
    }
Esempio n. 3
0
    void Start()
    {
        rb    = GetComponent <Rigidbody2D>();
        delay = Random.Range(mindelay, maxdelay);
        Scors scors = HIghScors.load();

        for (int i = 0; i < 10; i++)
        {
            hss[i] = scors.hs[i];
        }
        speed2 = speed;
    }
Esempio n. 4
0
    public static Scors load()
    {
        string path = Application.persistentDataPath + "/score.score";

        if (File.Exists(path))
        {
            BinaryFormatter format = new BinaryFormatter();
            FileStream      stream = new FileStream(path, FileMode.Open);

            Scors scors = format.Deserialize(stream) as Scors;
            stream.Close();

            return(scors);
        }
        else
        {
            return(null);
        }
    }