LoginSignup
7
6

More than 5 years have passed since last update.

Unity で新規作成されるスクリプトのフォーマット

Posted at

※ Mac 環境での解決策です

問題

Unity で C# スクリプトを新規作成すると以下の感じになる。

using UnityEngine;
using System.Collections;

public class Hoge : MonoBehaviour {

    // Use this for initialization
    void Start () {

    }

    // Update is called once per frame
    void Update () {

    }
}

個人的にはインデントはスペースがいいし、() 前にスペースがあるのもやだし、コメントもいらない。

解決

Applications/Unity/Unity.app/Contents/Resources/ScriptTemplates/81-C#\ Script-NewBehaviourScript.cs.txtがテンプレートになっているのでこれを修正する。

using UnityEngine;
using System.Collections;

public class Hoge : MonoBehaviour
{
    void Start()
    {
    }

    void Update()
    {
    }
}

{の位置は悩み中だけどひとまずおk。
念のためバックアップとっておくと良いと思う。

7
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
6