• 自定义修改Unity脚本模板


    在Unity Editor中Create C# script后,会自动生成初始化脚本:

     1 using System.Collections;
     2 using System.Collections.Generic;
     3 using UnityEngine;
     4 
     5 public class ScriptName : MonoBehaviour {
     6 
     7     // Use this for initialization
     8     void Start () {
     9         
    10     }
    11     
    12     // Update is called once per frame
    13     void Update () {
    14         
    15     }
    16 }

    这个是Unity默认脚本模板生成的,模板位于:
    "C:Program FilesUnityEditorDataResourcesScriptTemplates81-C# Script-NewBehaviourScript.cs.txt"
    可根据自己需要自定义自己想要的模板,如以下例子:

     1 /*
     2 * ==============================================================================
     3 *
     4 * Filename: $safeitemname$
     5 * Description: 
     6 *
     7 * Version: 1.0
     8 * Created: $time$
     9 * Compiler: Visual Studio 2017
    10 *
    11 * Author: Your name
    12 * Company: Your company name
    13 *
    14 * ==============================================================================
    15 */
    16 
    17 using System.Collections;
    18 using System.Collections.Generic;
    19 using UnityEngine;
    20 
    21 /// <summary>
    22 ///
    23 /// <summary>
    24 public class #SCRIPTNAME# : MonoBehaviour {
    25 
    26     // Use this for initialization
    27     void Start () {
    28         #NOTRIM#
    29     }
    30     
    31     // Update is called once per frame
    32     void Update () {
    33         #NOTRIM#
    34     }
    35 }

    除此之外,C:Program FilesUnityEditorDataResourcesScriptTemplates目录下还有其他类型的脚本模板,可根据需要进行修改!

  • 相关阅读:
    mac 配置 iterm2
    python面试题
    待办事项--flask
    八皇后问题c语言版(xcode下通过)
    对分布式一些理解
    观察者模式
    用redis实现悲观锁(后端语言以php为例)
    只用200行Go代码写一个自己的区块链!(转)
    php的生命周期的概述
    linux网络编程1 最简单的socket编程
  • 原文地址:https://www.cnblogs.com/MakeView660/p/12251764.html
Copyright © 2020-2023  润新知