• 自定义修改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目录下还有其他类型的脚本模板,可根据需要进行修改!

  • 相关阅读:
    7-25 念数字
    7-24 约分最简分式
    7-23 币值转换
    HDU-1102-Constructing Roads
    HDU-1301-Jungle Roads
    链式向前星
    HDU-1217-Arbitrage(SPFA)
    POJ-1258-Agri-Net
    HDU-1863-畅通工程
    POJ-3050-Hoscotch
  • 原文地址:https://www.cnblogs.com/MakeView660/p/12251764.html
Copyright © 2020-2023  润新知