75 lines
1.7 KiB
C#
75 lines
1.7 KiB
C#
![]() |
// ***********************************************************************
|
|||
|
// Company :
|
|||
|
// Author : KimCh
|
|||
|
// Created :
|
|||
|
//
|
|||
|
// Last Modified By : KimCh
|
|||
|
// Last Modified On :
|
|||
|
// ***********************************************************************
|
|||
|
namespace G
|
|||
|
{
|
|||
|
using UnityEngine;
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 游戏数据状态
|
|||
|
/// </summary>
|
|||
|
public class KDatabase : MonoBehaviour
|
|||
|
{
|
|||
|
#region Const
|
|||
|
|
|||
|
public const string ITEM_TABLE_NAME = "item";
|
|||
|
public const string AREA_TABLE_NAME = "area";
|
|||
|
public const string LEVEL_TABLE_NAME = "level";
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region Property
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 内存数据库
|
|||
|
/// </summary>
|
|||
|
public static Database Database
|
|||
|
{
|
|||
|
get;
|
|||
|
private set;
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region UNITY
|
|||
|
|
|||
|
private void Awake()
|
|||
|
{
|
|||
|
LoadDatabase();
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region ARCHIVE
|
|||
|
|
|||
|
/// <summary>
|
|||
|
///
|
|||
|
/// </summary>
|
|||
|
private static void LoadDatabase()
|
|||
|
{
|
|||
|
Database = Database.Create("main");
|
|||
|
var areaSchema = new Schema(AREA_TABLE_NAME, new string[] { "unlock" });
|
|||
|
Database.CreateTable(areaSchema);
|
|||
|
var itemSchema = new Schema(ITEM_TABLE_NAME, new string[] { "count" });
|
|||
|
Database.CreateTable(itemSchema);
|
|||
|
var levelSchema = new Schema(LEVEL_TABLE_NAME, new string[] { "star", "score" });
|
|||
|
Database.CreateTable(levelSchema);
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
///
|
|||
|
/// </summary>
|
|||
|
public static void SaveDatabase()
|
|||
|
{
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
}
|
|||
|
}
|