Unity/helloworld
提供: 初心者エンジニアの簡易メモ
helloworld
- File/new project/2Dを選択
- Assets/Create/C#Script
- 下にcsファイルができるのでHelloworldScript.csへ名前変更
- HelloworldScriptをダブルクリックしてMonoDevelopを開く
using UnityEngine;
using System.Collections;
public class HelloworldScript : MonoBehaviour {
// Use this for initialization
void Start () {
Debug.Log("helloworld");
}
// Update is called once per frame
void Update () {
}
}
- unityの開発画面に戻し、HelloworldScript.csをMainCameraへドラッグする
- unityの開発画面の左側のinspectorにHelloworldScripが関連づけられていることを確認
実行
- 上部中央の実行ボタンを押す
- consoleにhelloworldが表示されていることを確認
