资源简介
Unity Editor Console Pro 扩展点击定位到外部工程

代码片段和文件信息
using UnityEngine;
using System;
using System.Net;
using System.Collections.Generic;
namespace FlyingWormConsole3
{
public class ConsoleProRemoteServer : MonoBehaviour
{
#if !NETFX_CORE && !UNITY_WEBPlayer && !UNITY_WP8 && !UNITY_METRO
public class HTTPContext
{
public HttpListenerContext context;
public string path;
public string Command
{
get
{
return WWW.UnEscapeURL(context.Request.Url.AbsolutePath);
}
}
public HttpListenerRequest Request
{
get
{
return context.Request;
}
}
public HttpListenerResponse Response
{
get
{
return context.Response;
}
}
public HTTPContext(HttpListenerContext inContext)
{
context = inContext;
}
public void RespondWithString(string inString)
{
Response.StatusDescription = “OK“;
Response.StatusCode = (int)HttpStatusCode.OK;
if (!string.IsNullOrEmpty(inString))
{
Response.ContentType = “text/plain“;
byte[] buffer = System.Text.Encoding.UTF8.GetBytes(inString);
Response.ContentLength64 = buffer.Length;
Response.OutputStream.Write(buffer0buffer.Length);
}
}
}
[System.SerializableAttribute]
public class QueuedLog
{
public string message;
public string stackTrace;
public LogType type;
}
public int port = 51000;
private static HttpListener listener = new HttpListener();
[NonSerializedAttribute]
public List logs = new List();
void Awake()
{
DontDestroyonload(gameobject);
Debug.Log(“Starting Console Pro Server on port : “ + port);
listener.Prefixes.Add(“http://*:“+port+“/“);
listener.Start();
listener.BeginGetContext(ListenerCallback null);
}
#if UNITY_4_0 || UNITY_4_0_1 || UNITY_4_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_5 || UNITY_4_6
void OnEnable()
{
Application.RegisterLogCallback(LogCallback);
}
void Update()
{
Application.RegisterLogCallback(LogCallback);
}
void LateUpdate()
{
Application.RegisterLogCallback(LogCallback);
}
void OnDisable()
{
Application.RegisterLogCallback(null);
}
#else
void OnEnable()
{
Application.logMessageReceived += LogCallback;
}
void OnDisable()
{
Application.logMessageReceived -= LogCallback;
}
#endif
public void LogCallback(string logString string stackTrace LogType type)
{
if(!logString.StartsWith(“CPIGNORE“))
{
QueueLog(logString stackTrace type);
}
}
void QueueLog(string logString string stackTrace LogType type)
{
logs.Add(new QueuedLog() { message = logString stackTrace = stackTrace type = type } );
}
void ListenerCallback(IAsyncResult result)
{
HTTPContext context = new HTTPContext(listener.EndGetContext(result));
HandleRequest(context);
listener.BeginGetContext(new AsyncCallback(ListenerCallback) null);
}
void HandleRequest(HTTPContext context)
{
// Debug.LogError(“HANDLE “ + context.Request.HttpMethod);
// Debug.LogError(“HANDLE “ + context.path);
bool foundCommand = false;
switch(context.Command)
{
case “/NewLogs
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3703 2015-07-28 04:44 ConsolePro\ConsoleProRemoteServer.cs
文件 264 2015-07-28 04:44 ConsolePro\ConsoleProRemoteServer.cs.me
文件 182784 2016-11-19 17:22 ConsolePro\Editor\ConsolePro.Editor.dll
文件 467 2016-11-15 20:23 ConsolePro\Editor\ConsolePro.Editor.dll.me
文件 191 2016-11-12 11:26 ConsolePro\Editor.me
文件 2954 2015-07-28 04:44 ConsolePro\Readme.txt
文件 179 2015-07-28 04:44 ConsolePro\Readme.txt.me
目录 0 2016-11-19 17:22 ConsolePro\Editor
目录 0 2016-11-12 11:26 ConsolePro
----------- --------- ---------- ----- ----
190542 9
相关资源
- Phoenix BIOS Editor.rar
- vue+elmentui+ueditor +KityFormula数学公式 编
- FCKeditor_2.5
- Struts2与Ueditor整合SSH+Ueditor
-
KindEditor与jwpla
yer集成,优化kindEdi - WebEx Recording Editor 31.14.1.9 完美绿化版
- ESET真正的企业版,含有两个版本的
- swagger-editor-3.6.26
- My_WCP_Watermark_Editor-去win10评估副本水印
- award_bios_editor1.2_win32.zip
- .net百度编辑器UEditor)上传图片跟上次
- eWebeditor 修正版 (解决在IE9-IE11 Chro
- SSM+UEditor
- SDI Editor.rar
- UsbEAm Hosts Editor285605
- jTessBoxEditor.zip
- swift-PSImageEditors一个简而至美的图片编
- GSD editor V5.0_gsd编辑器.rar
- WebEx Recording Editor 3.17
- ueditor for bos
- Tekrob Editor 2.3
- Ueditor demo
- SSM整合KindEditor-4.11编辑器
- War3ModelEditor源码
- Greenfish Icon Editor Pro图标编辑器
- PmxEditor_0222 汉化
- EDID编辑工具 Deltacast E-EDID Editor
- 3ml editor2汉化版
- vi_and_vim_editors_pocket_reference_second_edi
- ewebeditor v9.0 .net破解版
评论
共有 条评论