Exemplo n.º 1
0
        public static DeclareScreenEffect Create(int in_id, int in_pos, int in_res)
        {
            DeclareScreenEffect tmp = new DeclareScreenEffect();

            tmp._id  = in_id;
            tmp._pos = in_pos;
            tmp._res = in_res;

            return(tmp);
        }
Exemplo n.º 2
0
 public static void Convert(Dictionary <int, DeclareScreenEffect> data)
 {
     if (data == null)
     {
         return;
     }
     data.Clear();
     data.Add(1, DeclareScreenEffect.Create(1, 1, 15));
     data.Add(2, DeclareScreenEffect.Create(2, 1, 16));
     data.Add(3, DeclareScreenEffect.Create(3, 1, 17));
     data.Add(4, DeclareScreenEffect.Create(4, 1, 75));
 }
Exemplo n.º 3
0
        public static void SetData()
        {
            if (_dataCaches == null && LuaEnv.isLoadLuaCfg)
            {
                long startTime = DateTime.Now.Ticks;
                Dictionary <int, int[]> dic = LuaEnv.SharedLuaEnv.Global.Get <Dictionary <int, int[]> >("DataScreenEffect");
                if (dic == null)
                {
                    LuaEnv.SharedLuaEnv.DoString("DataScreenEffect = require 'Lua/Config/DataScreenEffect'");
                    dic = LuaEnv.SharedLuaEnv.Global.Get <Dictionary <int, int[]> >("DataScreenEffect");
                }

                if (dic != null)
                {
                    _dataCaches = new Dictionary <int, DeclareScreenEffect>(4);
                    foreach (var item in dic)
                    {
                        DeclareScreenEffect tmp = new DeclareScreenEffect();
                        tmp.Id  = item.Value[0];
                        tmp.Pos = item.Value[1];
                        tmp.Res = item.Value[2];

                        _dataCaches.Add(item.Key, tmp);
                    }
                }
                Record(startTime, DateTime.Now.Ticks, "ScreenEffect");
            }
            if (_dataCaches == null && _fillDataCallBack != null)
            {
                if (_dataCaches == null)
                {
                    long startTime = DateTime.Now.Ticks;
                    _dataCaches = new Dictionary <int, DeclareScreenEffect>(4);
                    _fillDataCallBack(_dataCaches);
                    Record(startTime, DateTime.Now.Ticks, "ScreenEffect");
                }
            }
        }