コード例 #1
0
    void Start()
    {
        save = FindObjectOfType <Sauvegarde>();
        if (Application.platform == RuntimePlatform.Android)
        {
            path = Path.Combine(Application.persistentDataPath, fileName);
        }
        else
        {
            path = Path.Combine(Application.streamingAssetsPath, fileName);
        }
        if (File.Exists(path) == false)
        {
            Save_Highest();
        }
        else
        {
            ChargefromFile();
        }
        NbGamePlayed++;
        float now = save.Get_assos() + 2 * save.Get_etude() + save.Get_sociabilite();

        if (save.Get_langue() == 0)
        {
            text.text = " Statistics : \n\n\n ";
        }
        else
        {
            text.text = " Statistiques : \n\n\n ";
        }

        if (now > HighestScore)
        {
            HighestScore = now;
            if (save.Get_langue() == 0)
            {
                text.text = text.text + " Félicitations ! Tu as battu ton meilleur score\n";
            }
            else
            {
                text.text = text.text + " Congratulations ! You've beated your Highest Score :D \n";
            }
        }

        Display_text();
        Save_Highest();
    }
コード例 #2
0
ファイル: Bars.cs プロジェクト: Cvsdm/EF-WAY
    void Start()
    {
        save = FindObjectOfType <Sauvegarde>();

        MaxEtude     = 200f;
        CurrentEtude = save.Get_etude();
        etude        = GameObject.Find("Etude").GetComponent <Slider>();
        textEtude    = GameObject.Find("TextEtude").GetComponent <Text>();
        UpdateEtude();

        MaxAssos     = 200f;
        CurrentAssos = save.Get_assos();
        assos        = GameObject.Find("Assos").GetComponent <Slider>();
        textAssos    = GameObject.Find("TextAssos").GetComponent <Text>();
        UpdateAssos();


        MaxSocial     = 200f;
        CurrentSocial = save.Get_sociabilite();
        social        = GameObject.Find("Sociability").GetComponent <Slider>();
        textSocial    = GameObject.Find("TextSocial").GetComponent <Text>();
        UpdateSocial();
    }
コード例 #3
0
 private float Get_points()
 {
     return(save.Get_assos() + 2 * save.Get_etude() + save.Get_sociabilite());
 }