private void LoadDailyRewardModel()
    {
        SaveDailyReward saveDailyReward = LoadDailyReward();

        //this._bLoadDailySucess = true;
        if (saveDailyReward == null)
        {
            CheckDailyReward.GetInstance().UpdateFirstPlay();
            int coin     = CheckDailyReward.GetInstance().GetCoin();
            int indexDay = CheckDailyReward.GetInstance().DailyRewardModel.IndexDay;
            ////////oogleAnalyticsV4.getInstance().LogEvent("Daily Reward", "Daily Reward " + indexDay.ToString(), string.Empty, 0L);

            DailyRewarDialog dialog = GameManager.Instance.OnShowDialog <DailyRewarDialog>("DailyAward");
            dialog.ParseData(coin, indexDay);
            this.AddDiamond(coin);
            //this._panelDailyReward.Show(indexDay, coin);
            //int num = PlayerPrefs.GetInt(Constant.UserCoin);
            //num += coin;
            //PlayerPrefs.SetInt(Constant.UserCoin, num);

            SaveDailyRewardModel(CheckDailyReward.GetInstance().DailyRewardModel);
        }
        else
        {
            CheckDailyReward.GetInstance().DailyRewardModel = saveDailyReward;
            this.ProcessDailyReward();
        }
    }
    public void SaveDailyRewardModel(SaveDailyReward saveDailyReward)
    {
        BinaryFormatter binaryFormatter = new BinaryFormatter();
        FileStream      fileStream      = File.Create(Application.persistentDataPath + "/dailyreward.savegame");

        binaryFormatter.Serialize(fileStream, saveDailyReward);
        fileStream.Close();
    }
    public SaveDailyReward LoadDailyReward()
    {
        SaveDailyReward result = null;

        if (File.Exists(Application.persistentDataPath + "/dailyreward.savegame"))
        {
            BinaryFormatter binaryFormatter = new BinaryFormatter();
            FileStream      fileStream      = File.Open(Application.persistentDataPath + "/dailyreward.savegame", FileMode.Open);
            result = (SaveDailyReward)binaryFormatter.Deserialize(fileStream);
            fileStream.Close();
        }
        return(result);
    }
 public void UpdateFirstPlay()
 {
     this._saveDailyReward          = new SaveDailyReward();
     this._saveDailyReward.StartDay = DateTime.UtcNow.ToString();
     this._saveDailyReward.IndexDay = 0;
 }