🐱 你好呀,我是陈皮皮~
🔧 不用紧张,像我们做开发的随身带个扳手很正常。
昵称:陈皮皮
用户名:ichenpipi
/ifaswind
职业:游戏客户端开发
地点:广东省,深圳市
微信:im_chenpipi
GitHub:https://github.com/ichenpipi
Gitee:https://gitee.com/ichenpipi
公众号:菜鸟小栈
[Unity Editor Tool] A front-end interface where you can create, edit, save and dynamically execute code snippets.
License: MIT License
🐱 你好呀,我是陈皮皮~
🔧 不用紧张,像我们做开发的随身带个扳手很正常。
昵称:陈皮皮
用户名:ichenpipi
/ifaswind
职业:游戏客户端开发
地点:广东省,深圳市
微信:im_chenpipi
GitHub:https://github.com/ichenpipi
Gitee:https://gitee.com/ichenpipi
公众号:菜鸟小栈
比如下面这个代码,需要用到 System.Diagnostics 命名空间
string resPath = "";
StackFrame[] stackFrames = new StackTrace(true).GetFrames();
if (stackFrames != null && stackFrames.Length > 0)
{
string scriptPath = stackFrames[0].GetFileName()?.Replace("\\", "/");
if (!string.IsNullOrEmpty(scriptPath))
{
int projectPathLength = Application.dataPath.Length - "Assets".Length;
int lastSlashIndex = scriptPath.LastIndexOf("/");
resPath = scriptPath.Substring(projectPathLength, lastSlashIndex - projectPathLength) + "/Res/";
Debug.Log($"res path = {resPath}");
}
}
否则就会报错了:
The type or namespace name `StackFrame' could not be found. Are you missing `System.Diagnostics' using directive?
UnityEngine.Debug:LogError (object)
ChenPipi.CodeExecutor.Example.InjectHelperCSharp:CompileCode (string) (at E:/Unity/Github/unity-code-executor/Editor/Scripts/Examples/InjectHelperCSharp.cs:198)
以下省略...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.