コード例 #1
0
    /// <summary>
    /// 更新行列式表
    /// </summary>
    void UpdateDeterminantTable()
    {
        Stopwatch watch = new Stopwatch();

        watch.Start();

        SQLiteTableMapAttribute tableAttribute = StrayFogConfigHelper.GetTableAttribute <XLS_Report_Determinant_Table_ReportDeterminant>();

        UnityEngine.Debug.LogFormat("Update【Determinant Table 】【{0}->{1}】", GetSrcData(tableAttribute), tableAttribute.sqliteTableName);

        List <XLS_Report_Determinant_Table_ReportDeterminant> reports = StrayFogConfigHelper.Select <XLS_Report_Determinant_Table_ReportDeterminant>();

        watch.Stop();
        UnityEngine.Debug.LogFormat("Select【Determinant Table 】SQLite Data =>{0} , Time=>{1} , Data=>【{2}】", reports.Count, watch.Elapsed, reports.JsonSerialize());

        if (reports.Count > 0)
        {
            watch.Reset();
            watch.Start();
            reports[0].Set_ReportTip("Update Determinant Table");
            reports[0].Set_DeterminantTip(Guid.NewGuid().ToString());
            StrayFogConfigHelper.Update(reports[0]);
            watch.Stop();
            UnityEngine.Debug.LogFormat("Update【Determinant Table】SQLite Data 【Same PK】=>{0} , Time=>{1}, Data=>【{2}】", reports.Count, watch.Elapsed, reports.JsonSerialize());
        }

        watch.Reset();
        watch.Start();
        reports = StrayFogConfigHelper.Select <XLS_Report_Determinant_Table_ReportDeterminant>();
        watch.Stop();
        UnityEngine.Debug.LogFormat("Select【Determinant Table】SQLite Data =>{0} , Time=>{1}", reports.Count, watch.Elapsed, reports.JsonSerialize());
    }
コード例 #2
0
    /// <summary>
    /// OnRunGUI
    /// </summary>
    protected override void OnRunGUI()
    {
        StrayFogGamePools.sceneManager.DrawLevelSelectButtonOnGUI();
        StrayFogGamePools.eventHandlerManager.DrawLevelSelectButtonOnGUI();
        if (GUILayout.Button("Update "))
        {
            XLS_Report_Determinant_Table_ReportDeterminant tbRd = StrayFogConfigHelper.Select <XLS_Report_Determinant_Table_ReportDeterminant>()[0];
            tbRd.Set_ReportTip(Guid.NewGuid().ToString());
            StrayFogConfigHelper.Update(tbRd);
            StrayFogConfigHelper.SaveExcelPackage();
            Debug.Log("Update" + tbRd + "=>" + tbRd.JsonSerialize());
        }
        if (GUILayout.Button("Insert"))
        {
            XLS_Report_Table_Report tbInsertRp = new XLS_Report_Table_Report(Guid.NewGuid().ToString().UniqueHashCode());
            Debug.Log(tbInsertRp + " Before Insert" + tbInsertRp.JsonSerialize());
            tbInsertRp.Set_stringCol("Insert" + Guid.NewGuid().ToString());
            StrayFogConfigHelper.Insert(tbInsertRp);
            StrayFogConfigHelper.SaveExcelPackage();
            Debug.Log("After Insert =>" + StrayFogConfigHelper.Select <XLS_Report_Table_Report>().JsonSerialize());
        }
        if (GUILayout.Button("Delete"))
        {
            XLS_Report_Table_Report tbDeleteRp = StrayFogConfigHelper.Select <XLS_Report_Table_Report>()[0];
            Debug.Log(tbDeleteRp + " Before Delete" + tbDeleteRp.JsonSerialize());
            StrayFogConfigHelper.Delete(tbDeleteRp);
            StrayFogConfigHelper.SaveExcelPackage();
            Debug.Log("After Delete =>" + StrayFogConfigHelper.Select <XLS_Report_Table_Report>().JsonSerialize());
        }
        if (GUILayout.Button("Reload All"))
        {
            List <XLS_Report_Table_Report> tbReloadRps = StrayFogConfigHelper.Select <XLS_Report_Table_Report>();
            if (tbReloadRps.Count > 0)
            {
                Debug.Log(tbReloadRps + " Before Reload" + tbReloadRps.JsonSerialize());
                StrayFogConfigHelper.Delete(tbReloadRps[0]);
            }
            StrayFogConfigHelper.Reload <XLS_Report_Table_Report>(enSQLiteReloadClassify.DiskCoverAllCahche);
            Debug.Log("After Reload =>" + StrayFogConfigHelper.Select <XLS_Report_Table_Report>().JsonSerialize());
        }

        if (GUILayout.Button("Reload Same"))
        {
            List <XLS_Report_Table_Report> tbReloadSameRps = StrayFogConfigHelper.Select <XLS_Report_Table_Report>();
            if (tbReloadSameRps.Count > 0)
            {
                Debug.Log(tbReloadSameRps + " Before Reload Same" + tbReloadSameRps.JsonSerialize());
                tbReloadSameRps[0].Set_stringCol("Reload Same");
                StrayFogConfigHelper.Update(tbReloadSameRps[0]);
            }
            StrayFogConfigHelper.Reload <XLS_Report_Table_Report>();
            Debug.Log("After Reload Same=>" + StrayFogConfigHelper.Select <XLS_Report_Table_Report>().JsonSerialize());
        }
    }