コード例 #1
0
ファイル: DemoSvrAndClient.cs プロジェクト: chunwaizung/DCMMO
 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
ファイル: ResourceSysTest.cs プロジェクト: chunwaizung/DCMMO
        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
ファイル: NPCSys.cs プロジェクト: chunwaizung/DCMMO
        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
ファイル: LoginUI.cs プロジェクト: chunwaizung/DCMMO
        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
ファイル: SelectRoleUI.cs プロジェクト: chunwaizung/DCMMO
        void OnLoginSvrComplete(int id, ProtoPacket proto)
        {
            DCLog.Log("to game world");

            Close();
        }