Create Script Template In Edit Mode
很多时候 许多类 的 格式 都是重复的,比如 从配置文件中映射出来的类。
这个时候写一个 类模板 就很节省时间了。
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();
}
Create Script Template In Edit Mode的更多相关文章
- Jmeter录制脚本过程及Could not create script recorder报错、您的连接不是私密连接报错
转载自 https://www.cnblogs.com/wwho/p/7173172.html Jmeter录制脚本过程及Could not create script recorder报错.您 ...
- 二、Jmeter录制脚本过程及Could not create script recorder报错、您的连接不是私密连接报错
两个报错:Could not create script recorder报错和您的连接不是私密连接报错 1.录制过程 * 打开jmeter * 点击Templated,选择Recoding模版 * ...
- 今天再给大家带点html5前端开发的干货模板“text/tpl”怎么用 script template怎么用
text/tpl 顾名思义就是模板,其实和C++模板函数类似的作用,就是利用他生成一个HMTL内容,然后append或者替换html里面 有什么好处,假如后端返回来的数据都是一样的,但是需要生成不同的 ...
- [Angular] Using ngTemplateOutlet to create dynamic template
I can use <tamplete> syntax and a entry component as a container to create a dynamic component ...
- [Angular Directive] Create a Template Storage Service in Angular 2
You need to define a <template> to be able to use it elsewhere in your app as a TemplateRef. Y ...
- 小白学习vue第五天-第二弹(全局局部、父子、注册语法糖,script/template抽离模板)
全局组件: 就是注册的位置在实例对象的外面 并且可以多个实例对象使用 而局部: 就是在实例对象的内部注册 父组件和子组件的关系 子组件就是在另一个组件里面注册的组件 组件注册语法糖: 就不用Vue.e ...
- MS-DOS Batch Script Template
@echo off @setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION @rem Name: @rem Purpose: @rem @rem Autho ...
- Umbraco(5)-Creating Master Template Part 1(翻译文档)
原文地址:http://www.ncloud.hk/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/umbraco5-creating-master-template-par ...
- Edit Individual GridView Cells in ASP.NET
Edit individual GridView cells without putting the entire row into edit mode.Examples using the SqlD ...
随机推荐
- python实现决策树
1.决策树的简介 http://www.cnblogs.com/lufangtao/archive/2013/05/30/3103588.html 2.决策是实现的伪代码 “读入训练数据” “找出每个 ...
- python 上下文管理器
作者:Vamei 出处:http://www.cnblogs.com/vamei 欢迎转载,也请保留这段声明.谢谢! 上下文管理器(context manager)是Python2.5开始支持的一种语 ...
- iPhone图标及启动画面大小 xcode5
启动画面 文件名 大小px Default.png 320*480 Default@2x.png 640*960 Default-568h@2x.png 640*1136 图标 文件名 大小px ...
- Qualcomm device使用ION memory manager取代PMEM
今天写好device,成功编译出CM,接下来肯定是调戏啦(你什么都没看到)~ BUG肯定也是一堆堆的!一开机,果然一堆error~可是尼玛,大蛋一放假就不见人了!!! 我自己折腾几个小时容易么我,我谷 ...
- js实现对身份证校验
var vcity={ 11:"北京",12:"天津",13:"河北",14:"山西",15:"内蒙古&quo ...
- hdu 3836 Equivalent Sets
题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=3836 Equivalent Sets Description To prove two sets A ...
- spring使用JdbcDaoSupport中封装的JdbcTemplate进行query
1.Dept package cn.hxex.springcore.jdbc; public class Dept { private Integer deptNo; private String d ...
- Android里面的命名规范
前前后后接触安卓也有一段时间了,但是对于Android命名规范这块一直没有太注意过.导致有的时候写出来的代码,前后的风格根本不一样,今天在网上查了一下,正好对自己来说可以好好的总结一下. 首先在And ...
- JSP基本知识
JSP基本原理: JSP本质是Servlet(一个特殊的Java类),当用户向指定Servlet发送请求时,Servlet利用输出流动态生成HTML页面.JSP通过在标准的HTML页面中嵌入Java代 ...
- PB中无法插入ole控件,解决办法
cmd /c for %i in (%windir%\system32\*.ocx) do regsvr32.exe /s %icmd /c for %i in (%windir%\system32\ ...