0

Whenever I create a C# script in Unity, the file is always headed with the following imports:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

Is there any way to add/remove default imports to this list? I can't count how many times I've needed to import System by hand just to use a String.

1 Answer 1

2

There are script templates that you can modify to your liking.

Navigate to your unity install path, mine is..

C:\Program Files\Unity\Hub\Editor\2020.3.0f1

Then navigate down through this series of directories

\Editor\Data\Resources\ScriptTemplates

For the normal template you can modify 81-C# Script-NewBehaviourScript.cs.txt in any text editor. Make sure not to remove the items enclosed in hash marks.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.