zoukankan      html  css  js  c++  java
  • Create Script Template In Edit Mode

    很多时候 许多类 的 格式 都是重复的,比如 从配置文件中映射出来的类。

    这个时候写一个 类模板 就很节省时间了。

    Code

     1     public static string TestPath = "Assets/Test.cs";
     2     public static string TestValue = ""test"";
     3     public static string TestCode =
     4 @"
     5 using UnityEngine;
     6 using System;
     7 using System.Text;
     8 using System.Reflection;
     9 using System.Collections;
    10 using System.Collections.Generic;
    11 using com.kuxiong.battlemodule;
    12 using System.Linq;
    13 
    14 namespace com.kuxiong.battlemodule
    15 {
    16     public class Test
    17     {
    18         public string name = " + TestValue + @";
    19     }
    20 }";
    21 
    22 
    23     [MenuItem("MyTest/Test")]
    24     public static void Test()
    25     {
    26         Debug.Log("Creating Test Vo");
    27 
    28         System.IO.File.WriteAllText(TestPath, TestCode);
    29 
    30         AssetDatabase.ImportAsset(TestPath);
    31         AssetDatabase.Refresh();
    32     }
  • 相关阅读:
    微信开发:MySQL utf8mb4 字符集
    Spring 事务
    Exception
    mysql系列之多实例介绍
    python连接MySQL
    1_archlinux_安装篇
    apache中如何调用CGI脚本
    1.1_Django简介及安装
    git分支合并脚本
    用python收集系统信息
  • 原文地址:https://www.cnblogs.com/chongxin/p/4513866.html
Copyright © 2011-2022 走看看