Create Script Template In Edit Mode
2015-05-19 10:31
375 查看
很多时候 许多类 的 格式 都是重复的,比如 从配置文件中映射出来的类。
这个时候写一个 类模板 就很节省时间了。
Code
这个时候写一个 类模板 就很节省时间了。
Code
public static string TestPath = "Assets/Test.cs"; public static string TestValue = "\"test\""; public static string TestCode = @" using UnityEngine; using System; using System.Text; using System.Reflection; using System.Collections; using System.Collections.Generic; using com.kuxiong.battlemodule; using System.Linq; namespace com.kuxiong.battlemodule { public class Test { public string name = " + TestValue + @"; } }"; [MenuItem("MyTest/Test")] public static void Test() { Debug.Log("Creating Test Vo"); System.IO.File.WriteAllText(TestPath, TestCode); AssetDatabase.ImportAsset(TestPath); AssetDatabase.Refresh(); }
相关文章推荐
- VSTO Check Cell is In Edit Mode or Not
- ExecuteInEditMode
- 关于DBGrideh出现Dataset not in edit or insert mode
- [ExecuteInEditMode] 和 [RequireComponent(typeof(UIRoot))]理解
- Inspector属性面板中[HideInInspector]、ExecuteInEditMode等属性介绍
- org.apache.hadoop.dfs.SafeModeException: Cannot create ***. Name node is in safe mode的解决
- hive查询异常:Cannot create directory /tmp/hive-root/。。。Name node is in safe mode.
- 销毁物体和ExecuteInEditMode
- unity开发 --------- ExecuteInEditMode
- org.apache.hadoop.hdfs.server.namenode.SafeModeException: Cannot create directory /user/hive/warehouse/page_view. Name node is in safe mode
- How to make JDev run ant script in debug mode permanently
- R12: How to add Microsoft Excel as Type to the Create Template List of Values in BI Publisher (Doc ID 1343225.1)
- (12)intellij Cannot create package/ Java class in Intellij IDEA with Maven template
- Setting Focus to a TextBox in an EditItemTemplate
- Create a new Database Instance (in SILENT mode)
- JDev: How to make JDev run ant script in debug mode permanently
- unity 中 ExecuteInEditMode
- hadoop mkdir: Cannot create directory /usr. Name node is in safe mode.
- How to Create a Secure Login Script in PHP and mySQL
- Unity3d 编辑器扩展系列-ExecuteInEditMode的使用