Exemplo n.º 1
0
 virtual protected void DebugMsg(int _cmd, byte[] _buffer, int offset, int _len, string _title, bool pIsComplete = true)
 {
     if (IsShowDebugLog)
     {
         System.Text.StringBuilder bufferstr = new System.Text.StringBuilder();
         bufferstr.Append("{");
         for (int i = offset; i < _len; i++)
         {
             if (i != offset)
             {
                 bufferstr.Append(",");
             }
             bufferstr.Append(_buffer[i]);
         }
         bufferstr.Append("}");
         string tmsg = string.Format("{0}-cmd:{1} title:{2}  长度:{3}  内容:{4}", mNetTag, _cmd, _title, _len, bufferstr);
         if (pIsComplete)
         {
             DLog.Log(tmsg);
         }
         else
         {
             DLog.LOGColor(DLogType.Log, tmsg, LogColor.YELLO);
         }
     }
 }
Exemplo n.º 2
0
 virtual public void InitScript(string _class, string _AppName)
 {
     if (_class.Length == 0 || mInitScript)
     {
         return;
     }
     if (_AppName.Equals(cNeedSetAppName))
     {
         DLog.LOGColor(DLogType.Error, string.Format("必须设置正确的AppName.Class = {0},GameObject = {1}", _class, gameObject.name), LogColor.YELLO);
         return;
     }
     try {
         mAppName     = _AppName;
         mCore        = AppCore.App[mAppName];
         mCodeTool    = mCore.SManager.CodeTool;
         mScriptClass = _class;
         mScriptType  = mCodeTool.GetLType(mScriptClass);
         mObject      = mCodeTool.GetCSLEObjectParmasByType(mScriptType, this);
         InitParamList();
         mCore.AddScriptInterface(this);
         CallScriptFunctionByName("Awake");
         mInitScript = true;
     }
     catch (Exception _erro)
     {
         DLog.LogError(string.Format("脚本初始化出错:Class = {0},AppName = {1},GameObject = {2},InitScript ->{3}", mScriptClass, mAppName, gameObject.name, _erro.ToString()));
     }
 }