Exemplo n.º 1
0
        private void Receive_ServerSenddata(NetPackage package)
        {
            scBroadcastIP mServerSendData = Protocol3Utility.getData <scBroadcastIP> (package.buffer, 0, package.buffer.Length);

            DebugSystem.Log("Server: " + mServerSendData.Ip);
            nReceiveCount++;
        }
Exemplo n.º 2
0
    public override void OnInspectorGUI()
    {
        DebugSystem myTarget = (DebugSystem)target;

        EditorGUILayout.HelpBox("Hotkeys:\n " + myTarget._cursor + " - Enable/Disable mouse cursor \n " + myTarget._ui + " - Enable/Disable debug UI", MessageType.None);

        EditorGUILayout.Space();

        myTarget.ShowCursor = EditorGUILayout.Toggle("Display cursor:", myTarget.ShowCursor);

        showContent = EditorGUILayout.Foldout(showContent, "Show canvas objects:");
        if (showContent)
        {
            myTarget.debugCanvas = EditorGUILayout.ObjectField("Main canvas: ", myTarget.debugCanvas, typeof(UnityEngine.Object), true) as Canvas;
            myTarget.screenSize  = EditorGUILayout.ObjectField("Screen Size: ", myTarget.screenSize, typeof(UnityEngine.Object), true) as UnityEngine.UI.Text;
            myTarget.screenRatio = EditorGUILayout.ObjectField("Screen Ratio: ", myTarget.screenRatio, typeof(UnityEngine.Object), true) as UnityEngine.UI.Text;
            myTarget.screenFPS   = EditorGUILayout.ObjectField("Screen FPS", myTarget.screenFPS, typeof(UnityEngine.Object), true) as UnityEngine.UI.Text;
            myTarget.appScene    = EditorGUILayout.ObjectField("App Scene: ", myTarget.appScene, typeof(UnityEngine.Object), true) as UnityEngine.UI.Text;
            myTarget.appName     = EditorGUILayout.ObjectField("App Name: ", myTarget.appName, typeof(UnityEngine.Object), true) as UnityEngine.UI.Text;
            myTarget.appMemory   = EditorGUILayout.ObjectField("App Memory", myTarget.appMemory, typeof(UnityEngine.Object), true) as UnityEngine.UI.Text;

            myTarget.systemType      = EditorGUILayout.ObjectField("System Type: ", myTarget.systemType, typeof(UnityEngine.Object), true) as UnityEngine.UI.Text;
            myTarget.systemOS        = EditorGUILayout.ObjectField("System OS: ", myTarget.systemOS, typeof(UnityEngine.Object), true) as UnityEngine.UI.Text;
            myTarget.systemMemory    = EditorGUILayout.ObjectField("System Memory: ", myTarget.systemMemory, typeof(UnityEngine.Object), true) as UnityEngine.UI.Text;
            myTarget.systemGPUmemory = EditorGUILayout.ObjectField("System GPU:", myTarget.systemGPUmemory, typeof(UnityEngine.Object), true) as UnityEngine.UI.Text;
            myTarget.systemProcess   = EditorGUILayout.ObjectField("System Process: ", myTarget.systemProcess, typeof(UnityEngine.Object), true) as UnityEngine.UI.Text;
            myTarget.systemAccGyro   = EditorGUILayout.ObjectField("System Acc/Gyro: ", myTarget.systemAccGyro, typeof(UnityEngine.Object), true) as UnityEngine.UI.Text;
        }
    }
Exemplo n.º 3
0
        private void CheckReceivePackageLoss(NetUdpFixedSizePackage mPackage)
        {
            if (mPackage.nOrderId == nCurrentWaitReceiveOrderId)
            {
                CheckCombinePackage(mPackage);
                AddReceivePackageOrderId();

                while (!mReceiveLossPackageDic.IsEmpty)
                {
                    NetUdpFixedSizePackage mTempPackage = null;
                    if (mReceiveLossPackageDic.TryRemove(nCurrentWaitReceiveOrderId, out mTempPackage))
                    {
                        CheckCombinePackage(mTempPackage);
                        AddReceivePackageOrderId();
                    }
                    else
                    {
                        break;
                    }
                }
            }
            else if (mPackage.nOrderId > nCurrentWaitReceiveOrderId)
            {
                if (mReceiveLossPackageDic.TryAdd(mPackage.nOrderId, mPackage))
                {
                    DebugSystem.LogError("Server Package Loss: " + nCurrentWaitReceiveOrderId + " | " + mPackage.nOrderId);
                }
            }
            else
            {
                DebugSystem.LogError("Server 接受 过去的 废物包: " + mPackage.nOrderId);
                ObjectPoolManager.Instance.mUdpFixedSizePackagePool.recycle(mPackage);
            }
        }
Exemplo n.º 4
0
    public virtual void Awake()
    {
        if (!gameObject.activeInHierarchy)
        {
            return;
        }
        _stats = (IInteractable)GetComponent(typeof(IInteractable));
        if (_stats == null)
        {
            _stats = gameObject.AddComponent <InteractableStatsComponent>();
        }

        if (GetComponent <Selectable>() == null)
        {
            gameObject.AddComponent <Selectable>();
        }

        if (GetComponent <Collider>() == null)
        {
            DebugSystem.Log("Interactable " + gameObject.name + " does not have a have a collider!", LogType.Error);
            gameObject.SetActive(false);
            return;
        }

        gameObject.layer = LayerMask.NameToLayer(InteractableLayerName);
    }
Exemplo n.º 5
0
        private void ProcessAccept(SocketAsyncEventArgs e)
        {
            Socket s = e.AcceptSocket;
            SocketAsyncEventArgs ioReadContext  = ioContextPool.Pop();
            SocketAsyncEventArgs ioWriteContext = ioContextPool.Pop();

            mUsedContextPool.Add(ioReadContext);
            if (ioReadContext != null)
            {
                SocketAsyncEventArgs_Token mClient = new Client();
                mClient.init(s, ioWriteContext);
                ioReadContext.UserToken = mClient;

                m_numConnectedSockets++;
                string outStr = String.Format("客户 {0} 连入, 共有 {1} 个连接。", s.RemoteEndPoint.ToString(), this.m_numConnectedSockets);
                DebugSystem.Log(outStr);

                ClientFactory.Instance.AddClient((Client)mClient);

                if (!s.ReceiveAsync(ioReadContext))
                {
                    this.ProcessReceive(ioReadContext);
                }
            }
            else
            {
                s.Send(Encoding.Default.GetBytes("连接已经达到最大数!"));
                string outStr = String.Format("连接已满,拒绝 {0} 的连接。", s.RemoteEndPoint);
                DebugSystem.Log(outStr);
                s.Close();
            }

            this.StartAccept(e);
        }
Exemplo n.º 6
0
        private void ProcessExcept(Socket mSocket)
        {
            mSocket.Close();
            mSocket = null;

            DebugSystem.LogError("Socket 异常关闭");
        }
Exemplo n.º 7
0
 // Create all systems
 public void initializeSystems()
 {
     gravSystem         = new GravitySystem(level); systems.Add(gravSystem);
     moveSystem         = new MovementSystem(level); systems.Add(moveSystem);
     playerSystem       = new PlayerMovementSystem(level); systems.Add(playerSystem);
     visSystem          = new VisionOrbSystem(level); systems.Add(visSystem);
     colSystem          = new CollisionDetectionSystem(level); systems.Add(colSystem);
     drawSystem         = new DrawSystem(level.g, level); systems.Add(drawSystem);
     healthSystem       = new HealthSystem(level); systems.Add(healthSystem);
     animSystem         = new AnimationSystem(level); systems.Add(animSystem);
     timerSystem        = new TimerSystem(level); systems.Add(timerSystem);
     timedShooterSystem = new TimedShooterSystem(level); systems.Add(timedShooterSystem);
     squishSystem       = new SquishSystem(level); systems.Add(squishSystem);
     inputSystem        = new InputSystem(level); systems.Add(inputSystem);
     scrEdgeSystem      = new ScreenEdgeSystem(level); systems.Add(scrEdgeSystem);
     slSystem           = new SwitchListenerSystem(level); systems.Add(slSystem);
     switchSystem       = new SwitchSystem(level); systems.Add(switchSystem);
     spSystem           = new SimplePowerUpSystem(level); systems.Add(spSystem);
     simpEnemySystem    = new SimpleEnemyAISystem(level); systems.Add(simpEnemySystem);
     weapSystem         = new PlayerWeaponSystem(level); systems.Add(weapSystem);
     bkgPosSystem       = new BackgroundPositionSystem(level); systems.Add(bkgPosSystem);
     debugSystem        = new DebugSystem(level); systems.Add(debugSystem);
     movPlatSystem      = new MovingPlatformSystem(level); systems.Add(movPlatSystem);
     grapSystem         = new GrappleSystem(level); systems.Add(grapSystem);
     pushSystem         = new PushableSystem(level); systems.Add(pushSystem);
     velZeroSystem      = new VelToZeroSystem(level); systems.Add(velZeroSystem);
     smushSystem        = new SmushSystem(level); systems.Add(smushSystem);
     signSystem         = new SignSystem(level); systems.Add(signSystem);
 }
Exemplo n.º 8
0
 public void PrintSocketState(Socket mSocket)
 {
     DebugSystem.Log("------------------- Socket State ------------------------ ");
     DebugSystem.Log("IsBound: " + mSocket.IsBound);
     DebugSystem.Log("Connected: " + mSocket.Connected);
     DebugSystem.Log("---------------- Finish -------------------");
 }
Exemplo n.º 9
0
    private void Awake()
    {
        DebugSystem.Log("Sdk Init");
        try
        {
            //AndroidJavaClass jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
            // AndroidJavaObject activity = jc.GetStatic<AndroidJavaObject>("currentActivity");

            mObj = new AndroidJavaObject("com.xk.sharesdk.ShareSDK");

            if (mObj == null)
            {
                errorStr += "mObj is null\n";
                DebugSystem.LogError("mObj is null");
            }
            else
            {
                errorStr += "mObj is no null\n";
                DebugSystem.Log("mObj is no null");
            }

            int sum = mObj.Call <int>("AAA", 10, 15);
            errorStr += "sum1: " + sum + "\n";

            try
            {
                AndroidJavaObject mObj1 = new AndroidJavaObject("com.xk.sharesdk.BBB");

                if (mObj1 == null)
                {
                    errorStr += "mObj1 is null\n";
                    DebugSystem.LogError("mObj1 is null");
                }
                else
                {
                    errorStr += "mObj1 is no null\n";
                    DebugSystem.Log("mObj1 is no null");
                    mObj1.Set <int>("aaa", 200);
                    mObj1.Set <int>("bbb", 300);
                }
                sum       = mObj.Call <int>("AAA1", mObj1);
                errorStr += "sum2: " + sum + "\n";
            }catch (Exception e)
            {
                errorStr += "xk_Exception111: " + e.Message + "\n";
                DebugSystem.LogError("xk_Exception: " + e.Message);
            }

            BBB mBBB = new BBB();
            mBBB.aaa  = 100;
            mBBB.bbb  = 200;
            sum       = mObj.Call <int>("AAA1", mBBB);
            errorStr += "sum3: " + sum + "\n";
        }
        catch (Exception e)
        {
            errorStr += "xk_Exception: " + e.Message + "\n";
            DebugSystem.LogError("xk_Exception: " + e.Message);
        }
    }
Exemplo n.º 10
0
        public AssetInfo getAsseetInfo(string BundleName, string AssetName)
        {
            string bundleName = "";
            string assetName  = AssetName;
            string assetPath  = "";

            BundleName = CheckBundleName(BundleName);
            bundleName = BundleName;

            if (!GameConfig.Instance.orUseAssetBundle)
            {
                if (mBundleInfoDic.ContainsKey(bundleName))
                {
                    if (!assetName.StartsWith(mBundleInfoDic [bundleName]))
                    {
                        assetPath = mBundleInfoDic [bundleName] + "/" + assetName;
                    }
                    else
                    {
                        assetPath = assetName;
                    }
                }
                else
                {
                    DebugSystem.LogError("读取本地资源 有误:" + bundleName);
                }
            }
            return(new AssetInfo(assetPath, bundleName, assetName));
        }
Exemplo n.º 11
0
 public void PrintDbInfo()
 {
     FieldInfo[] mFieldInfo = this.GetType().GetFields();
     DebugSystem.Log(this.GetType().ToString() + ":");
     for (int i = 0; i < mFieldInfo.Length; i++)
     {
         FieldInfo mField = mFieldInfo[i];
         if (mField.FieldType.IsArray)
         {
             Array mArray = (Array)mField.GetValue(this);
             for (int j = 0; j < mArray.Length; j++)
             {
                 DebugSystem.Log(mField.Name + "[" + j + "]: " + mArray.GetValue(j));
             }
         }
         else if (mField.FieldType.IsGenericType)
         {
             IList mlist = mField.GetValue(this) as IList;
             for (int j = 0; j < mlist.Count; j++)
             {
                 DebugSystem.Log(mField.Name + "[" + j + "]: " + mlist[j]);
             }
         }
         else
         {
             DebugSystem.Log(mField.Name + ": " + mField.GetValue(this));
         }
     }
 }
Exemplo n.º 12
0
 public void SendNetStream(byte[] msg, int index, int Length)
 {
     try {
         SocketError merror;
         int         sendLength = clientSocekt.Send(msg, index, Length, SocketFlags.None, out merror);
         if (sendLength != Length)
         {
             DebugSystem.LogError("Client:SendLength:  " + sendLength + " | " + Length);
         }
         if (merror != SocketError.Success)
         {
             if (clientSocekt.Blocking == false && merror == SocketError.WouldBlock)
             {
                 SendNetStream(msg, index, Length);
             }
             else
             {
                 DebugSystem.LogError("发送失败: " + merror);
             }
         }
     } catch (SocketException e) {
         DebugSystem.LogError(e.SocketErrorCode + " | " + e.Message);
     } catch (Exception e) {
         DebugSystem.LogError(e.Message);
     }
 }
Exemplo n.º 13
0
        public virtual void Update(double elapsed)
        {
            mUdpCheckPool.Update(elapsed);

            int nPackageCount = 0;

            while (!mNeedHandlePackageQueue.IsEmpty)
            {
                NetPackage mNetPackage = null;
                if (!mNeedHandlePackageQueue.TryDequeue(out mNetPackage))
                {
                    break;
                }

                PackageManager.Instance.Execute(this as ClientPeer, mNetPackage);

                if (mNetPackage is NetCombinePackage)
                {
                    NetCombinePackage mCombinePackage = mNetPackage as NetCombinePackage;
                    ObjectPoolManager.Instance.mCombinePackagePool.recycle(mNetPackage as NetCombinePackage);
                }
                else if (mNetPackage is NetUdpFixedSizePackage)
                {
                    ObjectPoolManager.Instance.mUdpFixedSizePackagePool.recycle(mNetPackage as NetUdpFixedSizePackage);
                }

                nPackageCount++;
            }

            if (nPackageCount > 20)
            {
                DebugSystem.Log("服务器 处理逻辑的数量: " + nPackageCount);
            }
        }
Exemplo n.º 14
0
        private void SendThreadUpdate()
        {
            while (!bClosed)
            {
                int nPackageCount = 0;
                while (!mSendPackageQueue.IsEmpty)
                {
                    NetEndPointPackage mNetPackage = null;
                    if (!mSendPackageQueue.TryDequeue(out mNetPackage))
                    {
                        break;
                    }

                    this.SendNetStream(mNetPackage);

                    nPackageCount++;
                    if (nPackageCount > 50)
                    {
                        nPackageCount = 0;
                        Thread.Sleep(1);
                    }
                }

                Thread.Sleep(50);
            }

            DebugSystem.LogWarning("Server SendThread Safe Quit !");
        }
Exemplo n.º 15
0
        public void InitNet(string ip, UInt16 ServerPort)
        {
            bClosed   = false;
            this.port = ServerPort;
            this.ip   = ip;
            m_state   = NETSTATE.DISCONNECTED;

            mSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
            mSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);
            EndPoint bindEndPoint = new IPEndPoint(IPAddress.Parse(ip), port);

            mSocket.Bind(bindEndPoint);

            //mEndPointPool = new SafeObjectPool<IPEndPoint> (100);
            mSendPackageQueue    = new ConcurrentQueue <NetEndPointPackage> ();
            mReceivePackageQueue = new ConcurrentQueue <NetEndPointPackage> ();

            mHandleReceiveDataThread = new Thread(HandleReceiveData);
            mHandleReceiveDataThread.IsBackground = false;
            mHandleReceiveDataThread.Start();

            mReceiveThread = new Thread(ReceiveThreadUpdate);
            mReceiveThread.IsBackground = false;
            mReceiveThread.Start();

            mSendThread = new Thread(SendThreadUpdate);
            mSendThread.IsBackground = false;
            mSendThread.Start();

            mSocket.SendBufferSize    = 1024 * 1024 * 2;
            mSocket.ReceiveBufferSize = 1024 * 1024 * 2;
            DebugSystem.Log("Server ReceiveBufferSize: " + mSocket.ReceiveBufferSize);
            DebugSystem.Log("Server SendBufferSize: " + mSocket.SendBufferSize);
        }
Exemplo n.º 16
0
 //確認完成
 void OnCheckDone()
 {
     DebugSystem.AddLog(DebugSystem.DebugInfo.GetNewDebugInfo(
                            DebugSystem.DebugInfo.DebugLogTypeEnum.Info,
                            SystemName,
                            "注視" + this.gameObject.name + "確認完成 "));
 }
Exemplo n.º 17
0
        /// <summary>
        /// 从本地外部存储位置加载单个Bundle资源,全部加载
        /// </summary>
        /// <param name="BaseBundleInfo"></param>
        /// <returns></returns>
        private IEnumerator AsyncLoadFromLoaclSingleBundle(AssetBundleInfo BaseBundleInfo)
        {
            if (mBundleLockList.Contains(BaseBundleInfo.bundleName))
            {
                while (mBundleLockList.Contains(BaseBundleInfo.bundleName))
                {
                    yield return(null);
                }
                yield break;
            }
            mBundleLockList.Add(BaseBundleInfo.bundleName);
            yield return(CheckBundleDependentBundle(BaseBundleInfo));

            string path = AssetBundlePath.Instance.ExternalStorePathUrl;
            string url  = path + "/" + BaseBundleInfo.bundleName;
            WWW    www  = new WWW(url);

            yield return(www);

            if (www.isDone)
            {
                if (!string.IsNullOrEmpty(www.error))
                {
                    DebugSystem.LogError("www Load Error:" + www.error);
                    www.Dispose();
                    mBundleLockList.Remove(BaseBundleInfo.bundleName);
                    yield break;
                }
            }
            AssetBundle asset = www.assetBundle;

            SaveBundleToDic(BaseBundleInfo.bundleName, asset);
            mBundleLockList.Remove(BaseBundleInfo.bundleName);
            www.Dispose();
        }
        public virtual void Update(double elapsed)
        {
            mUdpCheckPool.Update(elapsed);

            int nPackageCount = 0;

            while (mNeedHandlePackageQueue.Count > 0)
            {
                NetPackage mNetPackage = null;
                if (!mNeedHandlePackageQueue.TryDequeue(out mNetPackage))
                {
                    break;
                }

                NetPackageExecute(mNetPackage);

                if (mNetPackage is NetCombinePackage)
                {
                    ObjectPoolManager.Instance.mCombinePackagePool.recycle(mNetPackage as NetCombinePackage);
                }
                else if (mNetPackage is NetUdpFixedSizePackage)
                {
                    ObjectPoolManager.Instance.mUdpFixedSizePackagePool.recycle(mNetPackage as NetUdpFixedSizePackage);
                }

                nPackageCount++;
            }

            if (nPackageCount > 10)
            {
                DebugSystem.Log("客户端 处理逻辑包的数量: " + nPackageCount);
            }
        }
        private bool GetPackage()
        {
            if (mParseStreamList.Length <= 0)
            {
                return(false);
            }

            NetPackage mNetPackage = new NetPackage();

            bool bSucccess = false;

            lock (mParseStreamList) {
                bSucccess = NetEncryptionStream.DeEncryption(mParseStreamList, mNetPackage);
            }

            if (bSucccess)
            {
                mLogicFuncDic [(UInt16)mNetPackage.command] (mNetPackage);
            }
            else
            {
                DebugSystem.LogError("服务器端 解码失败");
            }

            return(bSucccess);
        }
 public void AddClient(ClientPeer peer)
 {
     if (!mClientDic.TryAdd(peer.getPort(), peer))
     {
         DebugSystem.LogError("AddClient Error");
     }
 }
Exemplo n.º 21
0
        private void Receive_ServerSenddata(NetReceivePackage package)
        {
            scBroadcastIP mServerSendData = Protocol3Utility.getData <scBroadcastIP> (package.buffer.Array, package.buffer.Offset, package.buffer.Count);

            DebugSystem.Log("Client: " + mServerSendData.Ip);
            nReceiveCount++;
        }
Exemplo n.º 22
0
        private void AddSendCheck(NetUdpFixedSizePackage mPackage)
        {
            if (ServerConfig.bNeedCheckPackage)
            {
                //mPackage.nOrderId = nCurrentWaitSendOrderId;

                UInt16           nOrderId   = mPackage.nOrderId;
                CheckPackageInfo mCheckInfo = mCheckPackagePool.Pop();
                mCheckInfo.nReSendCount = 0;
                mCheckInfo.mPackage     = mPackage;
                mCheckInfo.mTimer.restart();

                if (mWaitCheckSendDic.TryAdd(nOrderId, mCheckInfo))
                {
                    //AddSendPackageOrderId ();
                }
                else
                {
                    throw new Exception("请增大循环Id 的范围,或者 减慢发包速度");
                }
            }

            DebugSystem.Assert(mPackage.nOrderId >= ServerConfig.nUdpMinOrderId);
            //DebugSystem.Log ("Server Send nOrderId: " + mPackage.nOrderId);
            mUdpPeer.SendNetPackage(mPackage);
        }
Exemplo n.º 23
0
        private void SendNetStream(byte[] msg, int offset, int Length)
        {
            DebugSystem.Assert(Length >= ClientConfig.nUdpPackageFixedHeadSize, "发送长度要大于等于 包头: " + Length);
            int nSendLength = mSocket.SendTo(msg, offset, Length, SocketFlags.None, remoteEndPoint);

            DebugSystem.Assert(nSendLength > 0, "Client 发送失败: " + nSendLength);
        }
Exemplo n.º 24
0
        private void SendThreadUpdate()
        {
            int nPackageCount = 0;

            while (true)
            {
                while (!mSendPackageQueue.IsEmpty)
                {
                    NetPackage mNetPackage = null;
                    if (!mSendPackageQueue.TryDequeue(out mNetPackage))
                    {
                        break;
                    }

                    SendNetStream(mNetPackage.buffer, 0, mNetPackage.Length);
                    Thread.Sleep(1);
                }

                if (bClosed)
                {
                    break;
                }

                Thread.Sleep(50);
            }

            DebugSystem.LogWarning("Client SendThread Safe Quit !");
        }
Exemplo n.º 25
0
        private void CheckReceivePackageLoss(NetUdpFixedSizePackage mPackage)
        {
            if (mPackage.nOrderId == nCurrentWaitReceiveOrderId)
            {
                CheckCombinePackage(mPackage);
                AddReceivePackageOrderId();
                while (mReceiveLossPackageDic.Count > 0)
                {
                    if (mReceiveLossPackageDic.ContainsKey(nCurrentWaitReceiveOrderId))
                    {
                        mPackage = mReceiveLossPackageDic [nCurrentWaitReceiveOrderId];
                        mReceiveLossPackageDic.Remove(nCurrentWaitReceiveOrderId);

                        CheckCombinePackage(mPackage);
                        AddReceivePackageOrderId();
                    }
                    else
                    {
                        break;
                    }
                }
            }
            else if (mPackage.nOrderId > nCurrentWaitReceiveOrderId)
            {
                mReceiveLossPackageDic [mPackage.nOrderId] = mPackage;
                DebugSystem.Log("Client loss Pcakge: " + nCurrentWaitReceiveOrderId + " | " + mPackage.nOrderId);
            }
            else
            {
                DebugSystem.LogError("Client 接受 过去的 废物包: " + mPackage.nOrderId);
            }
        }
Exemplo n.º 26
0
        IEnumerator Run()
        {
            yield return(new WaitForSeconds(1f));

            for (int i = 0; i < 2; i++)
            {
                GameObject obj = new GameObject();
                obj.AddComponent <UDPClientTest> ();
                yield return(0);
            }

            bStartSendPackage = true;

            while (true)
            {
                if (nSendCount >= nMaxSendCount && nSendCount >= nReceiveCount)
                {
                    DebugSystem.LogWarning("客户端 发送接受数量: " + nSendCount + " | " + nServerReceiveCount + " | " + nReceiveCount);
                    yield return(0);
                }
                else
                {
                    yield return(0);
                }
            }
        }
Exemplo n.º 27
0
 /// <summary>
 /// 检查资源配置文件
 /// </summary>
 /// <returns></returns>
 private void CheckAssetInfo(string url, List <AssetBundleInfo> mUpdateABInfoList)
 {
     mDownLoadAssetInfo.url = url;
     foreach (AssetBundleInfo k in mUpdateABInfoList)
     {
         AssetBundleInfo mBundleInfo = mExternalStoreABInfoList.Find((x) =>
         {
             if (x.mHash.isValid && k.mHash.isValid)
             {
                 return(x.mHash.Equals(k.mHash));
             }
             else
             {
                 DebugSystem.LogError("Hash is no Valid");
                 return(false);
             }
         });
         if (mBundleInfo == null)
         {
             mDownLoadAssetInfo.mAssetNameList.Add(k.bundleName);
         }
     }
     if (mDownLoadAssetInfo.mAssetNameList.Count > 0)
     {
         mDownLoadAssetInfo.mAssetNameList.Add(AssetBundlePath.AssetDependentFileBundleName);
     }
     DebugSystem.Log("需要下载更新的个数:" + mDownLoadAssetInfo.mAssetNameList.Count);
 }
Exemplo n.º 28
0
 public void OnFind()
 {
     DebugSystem.AddLog(DebugSystem.DebugInfo.GetNewDebugInfo(
                            DebugSystem.DebugInfo.DebugLogTypeEnum.Info,
                            SystemName,
                            this.gameObject.name + "發現主角"));
 }
Exemplo n.º 29
0
 //離開視野
 void OnChangeToExitLook()
 {
     DebugSystem.AddLog(DebugSystem.DebugInfo.GetNewDebugInfo(
                            DebugSystem.DebugInfo.DebugLogTypeEnum.Info,
                            SystemName,
                            this.gameObject.name + "消失了"));
 }
Exemplo n.º 30
0
 public void OnDisappear()
 {
     DebugSystem.AddLog(DebugSystem.DebugInfo.GetNewDebugInfo(
                            DebugSystem.DebugInfo.DebugLogTypeEnum.Info,
                            SystemName,
                            "主角離開" + this.gameObject.name + "視線"));
 }
Exemplo n.º 31
0
	void OnEnable () {
		DebugSystem = (DebugSystem)target ;
	}
Exemplo n.º 32
0
 // Use this for initialization
 void Awake()
 {
     instance = this;
     //InitDebugGUI();
     ClearLog();
 }