Пример #1
0
 void OnDestroy()
 {
     DCLog.Log("end main");
     mChannel.DisposeRes();
     mChannel.Close();
     mServer.DisposeRes();
     mServer.Close();
 }
Пример #2
0
 public static void RemoveNormal(DCBaseTimer timer)
 {
     if (null == Instance)
     {
         return;
     }
     DCLog.Log("add to remove");
     Instance.mToDelTimerSet.Add(timer);
 }
Пример #3
0
        void Start()
        {
            var asset1 = Resources.Load <TextAsset>("test");     //not null
            var asset2 = Resources.Load <TextAsset>("test.txt"); //null

            DCLog.Log("end");

//            Resources.Load<Texture2D>("");
        }
Пример #4
0
        public static void Test()
        {
            var asset1 = AssetDatabase.LoadAssetAtPath <TextAsset>("Assets/DCMMO/Resources/test");     //null
            var asset2 = AssetDatabase.LoadAssetAtPath <TextAsset>("Assets/DCMMO/Resources/test.txt"); //not null

            //asset bundle need extension

            DCLog.Log("end");
        }
Пример #5
0
        public void ReleaseId(int id)
        {
            var index = id - base_index;

            if (index < 0 || index >= mIdPool.Length)
            {
                DCLog.Log("out range id: " + id);
                return;
            }
            mIdPool[index] = 0;
        }
Пример #6
0
        void OnAddRoleRes(int id, ProtoPacket proto)
        {
            //yeah , let's go to the game world
            DCLog.Log("yeah , let's go to the game world!");
            Close();

            MsgSys.Send(PlayerEvt.close_select_role_ui);

            var sceneId = ParamsCfgMgr.Instance.GetInt((int)PParamsConfig.BeginnerScene);

            LoadScene(sceneId);
        }
Пример #7
0
        public void Destroy()
        {
            DCLog.Log("Destroy 1");
            if (mDestroyed)
            {
                return;
            }
            mDestroyed = true;
            DCLog.Log("Destroy 2");

            if (mPhysic)
            {
                DCTimer.RemovePhysic(this);
            }
            else
            {
                DCTimer.RemoveNormal(this);
            }
        }
Пример #8
0
        public Dictionary <string, string> BuildAssetExtensionMap(string root)
        {
            var allFile = Directory.GetFiles(root, "*.*", SearchOption.AllDirectories).Where((item) => !item.EndsWith("meta")).ToList();

            DCLog.Log(allFile.Count.ToString());

            var dic = new Dictionary <string, string>();

            foreach (var aFile in allFile)
            {
                var unixFilePath = aFile.Replace('\\', '/');
                var assetPath    = unixFilePath.Replace(Application.dataPath, "Assets");

                var point          = assetPath.LastIndexOf('.');
                var pathWithOutExt = assetPath.Substring(0, point);
                var ext            = assetPath.Substring(point);
                dic.Add(pathWithOutExt, ext);
            }

            return(dic);
        }
Пример #9
0
        void OnLoginComplete(int code, string result)
        {
            if (code == 1)
            {
                var jsonNode = JSON.Parse(result);
                int svrCode  = jsonNode["result"];
                if (svrCode == 1)
                {
                    var token = jsonNode["token"];
                    DCLog.Log(token);
                    PlayerDataMgr.Instance.UserToken = token;

                    //to login game svr
                    var svrCfg = GameServerDataMgr.Instance.GetLastLoginSvr();
                    RequestRoleData(svrCfg);
                }
            }
            else if (code == 2)
            {
                DCLog.LogEx("net or http error ", result);
            }
        }
Пример #10
0
        void OnLoginSvrComplete(int id, ProtoPacket proto)
        {
            DCLog.Log("to game world");

            Close();
        }