Пример #1
0
    public override void Init()
    {
        instance = this;
        // SceneManager.sceneLoaded += OnSceneLoaded;
        dicScene       = new Dictionary <int, CSceneBase>();
        loadSceneStack = new Stack <int>();
        needUpdate     = true;

        //初始化测试数据
        var tmp = new CDataTable();

        tmp.Init();
        var sd = new CTableScene();

        sd.id   = 1;
        sd.name = "test";
        tmp.AddData(sd);
        CDatabase.Instance.AddData <CTableScene>(tmp);
    }
Пример #2
0
 public void AddData(CTableScene data)
 {
     if (dicData.ContainsKey(data.id))
     {
         dicData[data.id] = data;
         int len = listData.Count;
         for (int i = 0; i < len; i++)
         {
             if (listData[i].id == data.id)
             {
                 listData[i] = data;
                 break;
             }
         }
     }
     else
     {
         dicData.Add(data.id, data);
         listData.Add(data);
     }
 }