---
title: "小テスト：Create with Code 1"
content_type: quiz
url: "https://learn.unity.com/quiz/quiz-create-with-code-1-jp?language=ja"
language: ja
difficulty: beginner
duration_minutes: 20
question_count: 11
correct_answers_to_pass: 9
supports_all_unity_versions: true
available_languages:
  - name: "en"
    url: "https://learn.unity.com/quiz/quiz-create-with-code-1.md?language=en"
  - name: "es"
    url: "https://learn.unity.com/quiz/prueba-como-crear-con-codigo-1.md?language=es"
  - name: "ja"
    url: "https://learn.unity.com/quiz/quiz-create-with-code-1-jp.md?language=ja"
  - name: "ko"
    url: "https://learn.unity.com/quiz/kwijeu-kodeuro-cangjaghagi-1.md?language=ko"
last_updated: "2026-08-04T14:25:12.000Z"
---

# 小テスト：Create with Code 1

この小テストでは、Create with Code 1 ミッションで学んだコンセプトの理解度を確認します。

この小テストでは、「Create with Code 1 Mission」で取り上げられたコンセプトの理解度を評価します。

## Question 1

以下のコードを実行すると、どのような結果になるでしょうか？

```csharp
public class Enemy : MonoBehaviour
{
    public Transform ground;

    void Update()
    {
        if (transform.position.y < ground.position.y)
        {
            Destroy(gameObject);
        }
    }
}
```

_Select only one_

- 敵が地上に出た場合は、敵を撃破する。
- プレイヤーが敵に触れると、そのプレイヤーを破壊する。
- 敵が地下に潜ったら、敵を撃破する。
- プレイヤーが地中に潜ったら、プレイヤーを破壊する。

## Question 2

以下のコメントを置き換えるには、どのようなコード行が適切でしょうか？

```csharp
public float[] values = values[5];

void Start()
{
 // assign the first element in the array the value of 5.0
}
```

_Select only one_

- float.0 = 5.0f;
- float\[0\] = 5.0f;
- values\[0\] = 5.0f;
- value\[1\] = 5.0f;

## Question 3

以下のコードの中で、最も適切なコメントはどれですか？

```csharp
public class Player : MonoBehaviour
{
  // Comment
  private void OnTriggerEnter(Collider other) {
    if(other.CompareTag("Spike")) {
      Destroy(other.gameObject);
    }
  }
}
```

_Select only one_

- // 敵がスパイクに衝突したら、敵を破壊する
- // プレイヤーがスパイクに衝突したら、スパイクを破壊する
- // プレイヤーがスパイクにぶつかったら、プレイヤーを破壊する
- // プレイヤーと敵が衝突したら、敵を破壊する

## Question 4

下の画像は、どのスクリプト編集ツール（または IDE）を使用するかを変更するための環境設定ウィンドウです。代替のコード編集ツールを選択するには、どこをクリックしますか？

![](https://connect-mediagw.unity.com/h1/20201001/learn/images/f43c3bb0-fe63-49bd-96bb-6be68da9e935_Obj_Prog_SCE_2.1.png)

_Select only one_

- Box 1 (External Script Editor)
- Box 2 (Image application)
- Box 3 (Revision control Diff/Merge)

## Question 5

Visual Studio では「5.0f;」に下線が引かれ、赤い四角い線が表示されます。エラーの上にマウスを乗せると、どのようなメッセージが表示されると思いますか？

```csharp
int health = 5.0f;
```

_Select only one_

- float 型を int 型に暗黙的に変換することができません。
- 値 5.0 は範囲外です。
- 値「f」は int 型に対して解釈することができませんでした。
- ステートメントを完了できません。セミコロンを削除してください。

## Question 6

以下のオートコンプリートポップアップウィンドウに表示される情報を使用して、次のうちどれが Instantiate メソッドの有効な呼び出しになりますか ?

![](https://connect-mediagw.unity.com/h1/20201001/learn/images/b2a0562a-375c-4917-9aa8-e17bfcc66e0c_Obj_Prog_SCE_2.4.png)

_Select only one_

- Instantiate(objectPrefab.transform, spawner, true);
- Instantiate(objectPrefab, spawner, false);
- Instantiate(objectPrefab, spawner.transform, true);
- Instantiate(objectPrefab, spawner, bool);

## Question 7

以下のようなデバッグメッセージを表示させるために必要なコードは何でしょうか？

Hello world.

_Select only one_

- Debug.Log("Hello world.");
- Debug(Log(“Hello world.”));
- Debug.Log(Hello world.);
- Debug(“Hello world.”);

## Question 8

Unity Monobehavior クラスの Start() 関数と Update() 関数のどちらかについて、次のうち正しいものはどれですか？

_Select only one_

- プレイヤー入力は、Update()関数で処理する必要があります。
- Start() 関数は、すべての Update() 関数の開始時に実行されます。
- Update() 関数は、Start() 関数の前に実行されます。
- Update() 関数は 1 回だけ実行されます。

## Question 9

このスクリプトの各パーツはどのような順序で表示されるのでしょうか？

```csharp
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerController : MonoBehaviour
{
 public float speed;
 public string playerName;

 void Start()
    {
        playerName = "Test";
    }

 void Update()
    {
        speed++;
    }

}
```

_Select only one_

- 変数、名前空間、関数、クラス宣言
- クラス宣言、名前空間、関数、変数
- 名前空間、クラス宣言、変数、関数
- 関数、クラス宣言、名前空間、変数

## Question 10

次のコード行のうち、Unity の標準的な命名規則を使っているものはどれですか？


1. Public Float Speed = 40.0f;
2. Public float Speed = 40.0f;
3. public float Speed = 40.0f;
4. public float speed = 40.0f;

_Select only one_

- Line 1
- Line 2
- Line 3
- Line 4

## Question 11

下のインスペクターに「Speed」と「Player Name」の変数が表示されている場合、PlayerController.cs  に表示されるコードの行はどれでしょうか？

![](https://connect-mediagw.unity.com/h1/20201002/learn/images/d07bb53c-a982-4574-8e5d-8c05501bc7af_SCE_2.3.png)

_Select only one_

- new Float speed;

  new String playerName;
- float speed;

  string playerName;
- public float Speed;

  public text Player Name;
- public float speed;

  public string playerName;
