親子で学ぶはじめてのプログラミング Unityで3Dゲームをつくろう!

掲載リスト


リスト2-1
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class script1 : MonoBehaviour {

	// Use this for initialization
	void Start () {
		
	}
	
	// Update is called once per frame
	void Update () {
		
	}
}


リスト2-2
void Start () {
	Debug.Log("Hello!");
}


リスト2-3
void Start () {
	int price = 12300;
	float tax = 0.08f;
	float result = price * (1.0f + tax);
	Debug.Log("PRICE: " + result);
}


リスト2-4
void Start () {
	int num = 12345;
	if (num % 2 == 0){
		Debug.Log(num + "は偶数です。");
	} else {
		Debug.Log(num + "は奇数だよ！");
	}
}


リスト2-5
void Start () {
	string te = "グー";

	switch(te){
	case "グー":
		Debug.Log("あなた：" + te + "、私：パー。私の勝ち！");
		break;
	case "チョキ":
		Debug.Log("あなた：" + te + "、私：グー。私の勝ち！");
		break;
	case "パー":
		Debug.Log("あなた：" + te + "、私：チョキ。私の勝ち！");
		break;
	default:
		Debug.Log("……何を出したかわかりません……。");
		break;
	}
}


リスト2-6
void Start () {
	int max = 100;
	int total = 0;
	int num = 1;
	while(num <= max){
		total = total + num;
		num = num + 1;
	}
	Debug.Log(max + "までの合計: " + total);
}


リスト2-7
void Start () {
	int max = 100;
	int total = 0;
	int num = 1;
	while(num <= max){
		total += num;
		num++;
	}
	Debug.Log(max + "までの合計: " + total);
}


リスト2-8
void Start () {
	int max = 100;
	int total = 0;
	for(int i = 1;i <= max;i++){
		total += i;
	}
	Debug.Log(max + "までの合計: " + total);
}

リスト2-9
void Start () {
	string[] data = {"Hello", "OK!", "bye."};
	Debug.Log(data[0] + ",Taro.");
	Debug.Log(data[1] + " Hanako!");
	Debug.Log("Sachiko, " + data[2]);
}


リスト2-10
void Start () {
	int[] data = {
		98, 76, 54, 68, 79, 63, 50, 99, 45, 71
	};
	int count = 10;
	int total = 0;
	foreach(int num in data){
		total += num;
	}
	int ave = total / count;
	Debug.Log("合計：" + total + "　平均：" + ave);
}


リスト2-11
public class script1 : MonoBehaviour {

	void Start () {
	}

	void Update () {
	}
}


リスト2-12
public class script1 : MonoBehaviour {
	string myname;
	int myage;

	void Start () {
		myname = "Hanako";
		myage = 35;
		string msg = GetMessage();
		PrintMsg(msg);
	}

	void Update () {
	}

	string GetMessage(){
		string msg = "こんにちは、" + myname + "（" + myage + "）さん。";
		return msg;
	}

	void PrintMsg(string msg){
		Debug.Log(msg);
	}
}


リスト2-13
public class script1 : MonoBehaviour {

	void Start () {
		MyCalc obj = new MyCalc();
		obj.tax = 0.08f;
		obj.PrintData(15800);
	}

	void Update () {
		Vector3 v = new Vector3(1f, 1f, 0f);
		transform.Rotate(v);
	}

}

class MyCalc {
	public float tax;

	float GetPrice(int p){
		return p * (1.0f + tax);
	}

	public void PrintData(int p){
		Debug.Log(p + "の税込価格は、" + GetPrice(p) + "円です。");
	}
}


リスト2-14
public class script1 : MonoBehaviour {

	void Start () {
		MyCalc obj = new MyCalc(0.08f);
		obj.PrintData(15800);
	}

	void Update () {
	}

}

public class MyCalc {
	public float tax;

	public MyCalc(float t){
		tax = t;
	}

	float GetPrice(int p){
		return p * (1.0f + tax);
	}

	public void PrintData(int p){
		Debug.Log(p + "の税込価格は、" + GetPrice(p) + "円です。");
	}
}


リスト2-15
public class script1 : MonoBehaviour {

	void Start () {
		AlterCalc obj = new AlterCalc(0.08f, 15000);
		obj.PrintData();
	}

	void Update () {
	}

}

public class MyCalc {
	public float tax;

	public MyCalc(){
		tax = 0.08f;
	}

	public MyCalc(float t){
		tax = t;
	}

	float GetPrice(int p){
		return p * (1.0f + tax);
	}

	public void PrintData(int p){
		Debug.Log(p + "の税込価格は、" + GetPrice(p) + "円です。");
	}
}

public class AlterCalc : MyCalc {
	int price;

	public AlterCalc(float t, int p){
		tax = t;
		price = p;
	}

	public void PrintData(){
		PrintData(price);
	}
}

リスト2-16
enum Janken {グー, チョキ, パー};

public class script1 : MonoBehaviour {

	void Start () {
		Janken te = Janken.グー;
		Debug.Log("あなたは、" + te + "です。");
	}

	void Update () {
	}

}


リスト2-17
struct MyData {
	public string name;
	public int age;
	public string mail;

	public MyData(string n, int a, string m){
		name = n;
		age = a;
		mail = m;
	}

	public void print(){
		Debug.Log("私は、" + name + "です。" + age + 
			"歳です。メールアドレスは、" + mail + "です。");
	}
}

public class script1 : MonoBehaviour {

	void Start () {
		MyData obj = new MyData("太郎",45, "taro@yamada");
		obj.print();
	}

	void Update () {
		Vector3 v = new Vector3(1f, 1f, 0f);
		transform.Rotate(v);
	}

}


リスト3-8
public class script1 : MonoBehaviour {
	
	void Start () {
	}

	void Update () {
		transform.Rotate(new Vector3(1f, 1f, 0f));

		Vector3 v = transform.position;

		if (Input.GetKey(KeyCode.LeftArrow)){
			v.x -= 0.1f;
		}
		if (Input.GetKey(KeyCode.RightArrow)){
			v.x += 0.1f;
		}
		if (Input.GetKey(KeyCode.UpArrow)){
			v.z += 0.1f;
		}
		if (Input.GetKey(KeyCode.DownArrow)){
			v.z -= 0.1f;
		}

		transform.position = v;
	}

}


リスト3-9
public class script1 : MonoBehaviour {
	float dx = 0.1f;
	float dz = 0;
	
	void Start () {
	}

	void Update () {
		transform.Rotate(new Vector3(1f, 1f, 0f));

		Vector3 v = transform.position;

		if (Input.GetKey(KeyCode.LeftArrow)){
			v.x -= dx;
		}
		if (Input.GetKey(KeyCode.RightArrow)){
			v.x += dx;
		}
		if (Input.GetKeyDown(KeyCode.Space)){
			dx = 0f;
			dz = 1f;
		}
		v.z += dz;
		transform.position = v;
	}

}


リスト3-10
public class script1 : MonoBehaviour {
	
	void Start () {
	}

	void Update () {
		transform.Rotate(new Vector3(1f, 1f, 0f));

		Vector3 v = transform.position;

		float x = Input.GetAxis("Horizontal");
		float z = Input.GetAxis("Vertical");
		v.x += x;
		v.z += z;
		transform.position = v;
	}

}


リスト3-11
public class script1 : MonoBehaviour {
	
	void Start () {
	}

	void Update () {
		bool f0 = Input.GetMouseButton(0);
		if (f0){
			transform.Rotate(new Vector3(1f, 1f, 0f));
		}
		bool f1 = Input.GetMouseButton(1);
		if (f1){
			transform.Rotate(new Vector3(-1f, -1f, 0f));
		}
	}

}


リスト3-12
public class script1 : MonoBehaviour {
	float d = 0.1f;
	bool flg = false;
	
	void Start () {
	}

	void Update () {
		transform.Rotate(new Vector3(1f, 1f, 0f));

		bool b1dn = Input.GetMouseButtonDown(0);
		if (b1dn){
			flg = true;
		}
		bool b1up = Input.GetMouseButtonUp(0);
		if (b1up){
			flg = false;
		}

		bool b2dn = Input.GetMouseButtonDown(1);
		if (b2dn){
			d *= -1f;
		}

		Vector3 v = transform.position;
		if (flg){
			v.z += d;
		}
		transform.position = v;
	}

}


リスト3-13
public class script1 : MonoBehaviour {
	
	void Start () {
	}

	void Update () {
		transform.Rotate(new Vector3(1f, 1f, 0f));

		float x = Input.GetAxis("Fire1") * 0.1f;
		float y = Input.GetAxis("Fire2") * 0.1f;
		Vector3 v = transform.position;
		v.z += x - y;
		transform.position = v;
	}

}


リスト4-1
public class script1 : MonoBehaviour {

	void Start () {
	}

	void Update () {
		transform.Rotate(new Vector3(1f, 1f, 0f));
		bool down = Input.GetMouseButton(0);
		Renderer render = GetComponent<Renderer>();
		if (down){
			render.material.color = Color.yellow;
		} else {
			render.material.color = Color.red;
		}
	}

}


リスト4-2
public class script1 : MonoBehaviour {
	Renderer render;

	void Start () {
		render = GetComponent<Renderer>();
		render.material.color = new Color(1f, 0.5f, 1f);
	}

	void Update () {
		transform.Rotate(new Vector3(1f, 1f, 0f));

		bool down = Input.GetMouseButtonDown(0);
		if (down){
			Color c = Random.ColorHSV();
			render.material.color = c;
		}
		bool up = Input.GetMouseButtonUp(0);
		if (up){
			render.material.color = new Color(1f, 0.5f, 1f);
		}
	}

}


リスト4-3
public class script1 : MonoBehaviour {
	Renderer render;
	Color color;
	float d = -0.005f;

	void Start () {
		render = GetComponent<Renderer>();
		color = render.material.color;
	}

	void Update () {
		transform.Rotate(new Vector3(1f, 1f, 0f));

		bool down = Input.GetMouseButton(0);
		if (down){
			if (color.a <= 0){
				d = 0.005f;
			}
			if (color.a >= 1){
				d = -0.005f;
			}
			color.a += d;
			render.material.color = color;
		}
	}

}


リスト4-4
public class script1 : MonoBehaviour {
	Renderer render;
	Texture txtr;

	void Start () {
		render = GetComponent<Renderer>();
		txtr = Resources.Load<Texture>("MudRockyNormals");
	}

	void Update () {
		transform.Rotate(new Vector3(1f, 1f, 0f));

		bool down = Input.GetMouseButtonDown(0);
		if (down){
			render.material.mainTexture = txtr;
		}
		bool up = Input.GetMouseButtonUp(0);
		if (up){
			render.material.mainTexture = null;
		}
	}

}


リスト4-5
public class script1 : MonoBehaviour {
	GameObject light;

	void Start () {
		light = GameObject.Find("Spotlight");
	}

	void Update () {
		transform.Rotate(new Vector3(1f, 1f, 0f));
		Vector3 lv = transform.position;
		Vector3 v0 = new Vector3(0f, 1f, 0f);
		light.transform.RotateAround(lv, v0, 1f);
	}
}

リスト4-6
public class script1 : MonoBehaviour {
	GameObject jimen;

	void Start () {
		jimen = GameObject.Find("Jimen");
	}

	void Update () {
		transform.Rotate(new Vector3(1f, 1f, 0f));

		bool down = Input.GetMouseButtonDown(0);
		if (down){
			jimen.SetActive(false);
			Debug.Log("disable...");
		}
		bool up = Input.GetMouseButtonUp(0);
		if (up){
			jimen.SetActive(true);
			Debug.Log("Active!");
		}
	}
}


リスト4-7
public class script1 : MonoBehaviour {

	void Start () {
	}

	void Update () {
		transform.Rotate(new Vector3(1f, 1f, 0f));

		bool down = Input.GetMouseButtonDown(0);
		if (down){
			gameObject.SetActive(false);
		}
		bool up = Input.GetMouseButtonUp(0);
		if (up){
			gameObject.SetActive(true);
		}
	}
}


リスト4-8
public class script1 : MonoBehaviour {

	void Start () {
	}

	void Update () {
		transform.Rotate(new Vector3(1f, 1f, 0f));

		bool f = Input.GetMouseButtonDown(0);
		if (f){
			Vector3 p = transform.position;
			MakeObject(p);
			p.x += 2f;
			p.z += 2f;
			transform.position = p;
		}
	}

	void MakeObject(Vector3 p){
		GameObject ob = GameObject.CreatePrimitive(PrimitiveType.Sphere);
		ob.transform.position = p;
		Renderer rd = ob.GetComponent<Renderer>();
		rd.material.color = Random.ColorHSV();
	}
}


リスト4-9
public class script1 : MonoBehaviour {
	public List<GameObject> list;

	void Start () {
		list = new List<GameObject>();
	}

	void Update () {
		Vector3 p = transform.position;

		float x = Input.GetAxis("Mouse X");
		float y = Input.GetAxis("Mouse Y");
		p.x += x;
		p.z += y;
		transform.position = p;

		bool f = Input.GetMouseButtonDown(0);
		if (f){
			MakeObject(p);
		}

		bool down = Input.GetMouseButtonDown(1);
		if (down){
			ChangeColor();
		}

		transform.Rotate(new Vector3(1f, 1f, 0f));
		RotateAll();
	}

	void MakeObject(Vector3 p){
		GameObject ob = GameObject.CreatePrimitive(PrimitiveType.Cube);
		ob.transform.position = p;
		Renderer rd = ob.GetComponent<Renderer>();
		rd.material.color = Random.ColorHSV();
		list.Add(ob);
	}

	void RotateAll(){
		foreach(GameObject ob in list){
			ob.transform.Rotate(new Vector3(1f, 1f, 1f));
		}
	}

	void ChangeColor(){
		Color c = Random.ColorHSV();
		foreach(GameObject ob in list){
			Renderer r = ob.GetComponent<Renderer>();
			r.material.color = c;
		}

	}
}


リスト4-10
public class script1 : MonoBehaviour {
	bool flg = true;

	void Start () {
		Vector3 p = Camera.main.transform.position;
		p.y += 3f;
		Camera.main.transform.position = p;
		Quaternion r = Camera.main.transform.rotation;
		r.x += 0.25f;
		Camera.main.transform.rotation = r;
	}

	void Update () {
		Vector3 p = transform.position;

		float x = Input.GetAxis("Mouse X");
		float y = Input.GetAxis("Mouse Y");
		p.x += x;
		p.z += y;
		transform.position = p;

		bool f = Input.GetMouseButtonDown(0);
		if (f){
			MakeObject(p);
		}

		bool down = Input.GetMouseButtonDown(1);
		if (down){
			ChangeColor();
		}

		transform.Rotate(new Vector3(1f, 1f, 0f));
		RotateAll();
	}

	void MakeObject(Vector3 p){
		GameObject ob = GameObject.CreatePrimitive(PrimitiveType.Cube);
		ob.transform.position = p;
		Renderer rd = ob.GetComponent<Renderer>();
		rd.material.color = Random.ColorHSV();
		if (flg){
			ob.tag = "Even";
		} else {
			ob.tag = "Odd";
		}
		flg = !flg;
	}

	void RotateAll(){
		GameObject[] odd = GameObject.FindGameObjectsWithTag("Odd");
		GameObject[] even = GameObject.FindGameObjectsWithTag("Even");
		foreach(GameObject ob in odd){
			ob.transform.Rotate(new Vector3(1f, 1f, 1f));
		}
		foreach(GameObject ob in even){
			ob.transform.Rotate(new Vector3(-1f, -1f, -1f));
		}
	}

	void ChangeColor(){
		Color c1 = Random.ColorHSV();
		Color c2 = Random.ColorHSV();
		GameObject[] odd = GameObject.FindGameObjectsWithTag("Odd");
		GameObject[] even = GameObject.FindGameObjectsWithTag("Even");
		foreach(GameObject ob in odd){
			Renderer r = ob.GetComponent<Renderer>();
			r.material.color = c1;
		}
		foreach(GameObject ob in even){
			Renderer r = ob.GetComponent<Renderer>();
			r.material.color = c2;
		}
	}
}


リスト4-11
public class script1 : MonoBehaviour {

	void Start () {
	}

	void Update () {
		transform.Rotate(new Vector3(1f, 1f, 0f));

		Behaviour halo = (Behaviour)gameObject.GetComponent("Halo");
		bool down = Input.GetMouseButtonDown(0);
		if (down){
			halo.enabled = true;
		}
		bool up = Input.GetMouseButtonUp(0);
		if (up){
			halo.enabled = false;
		}
	}

}


リスト4-12
public class script1 : MonoBehaviour {

	void Start () {
		Vector3 p = Camera.main.transform.position;
		p.z -= 5;
		Camera.main.transform.position = p;
	}

	void Update () {
		transform.Rotate(new Vector3(1f, 1f, 0f));

		bool down = Input.GetMouseButton(0);
		if (down){
			Vector3 v0 = Input.mousePosition;
			v0.z += 3f;
			Ray ray = Camera.main.ScreenPointToRay(v0);
			RaycastHit hit;
			bool f = Physics.Raycast(ray, out hit, 1000);
			if (f){
				if (hit.collider.gameObject.name == "Cube"){
					ParticleSystem ps = GetComponent<ParticleSystem>();
					ps.Play();
				}
			}
		}

	}

}


リスト4-13
ps.Emit(300);


リスト5-1
public class script1 : MonoBehaviour {

	void Start () {
	}

	void Update () {
		transform.Rotate(new Vector3(1f, 1f, 0f));

		float x = Input.GetAxis("Horizontal");
		float z = Input.GetAxis("Vertical");
		Vector3 p = transform.position;
		p.x += x * 0.1f;
		p.z += z * 0.1f;
		transform.position = p;
	}

	void OnCollisionEnter(Collision collision){
		Debug.Log("Collision: " + collision.gameObject.name);
	}

}


リスト5-2
public class script1 : MonoBehaviour {

	void Start () {
	}

	void Update () {
		transform.Rotate(new Vector3(1f, 1f, 0f));

		float x = Input.GetAxis("Horizontal");
		float z = Input.GetAxis("Vertical");
		Vector3 p = transform.position;
		p.x += x * 0.1f;
		p.z += z * 0.1f;
		transform.position = p;
	}

	void OnCollisionEnter(Collision collision){
		Behaviour halo = (Behaviour)gameObject.GetComponent("Halo");
		halo.enabled = true;
		Renderer r = collision.gameObject.GetComponent<Renderer>();
		r.material.color = Color.red;
	}

	void OnCollisionExit(Collision collision){
		Behaviour halo = (Behaviour)gameObject.GetComponent("Halo");
		halo.enabled = false;
		Renderer r = collision.gameObject.GetComponent<Renderer>();
		r.material.color = Color.green;
	}

}


リスト5-3
public class script1 : MonoBehaviour {

	void Start () {
	}

	void Update () {
		transform.Rotate(new Vector3(1f, 1f, 0f));

		float x = Input.GetAxis("Horizontal");
		float z = Input.GetAxis("Vertical");
		Vector3 p = transform.position;
		p.x += x * 0.1f;
		p.z += z * 0.1f;
		transform.position = p;
	}

	void OnTriggerEnter(Collider collider){
		Renderer r = collider.gameObject.GetComponent<Renderer>();
		Color c = r.material.color;
		c.a = 0.25f;
		r.material.color = c;
	}

	void OnTriggerExit(Collider collider){
		Renderer r = collider.gameObject.GetComponent<Renderer>();
		Color c = r.material.color;
		c.a = 1.0f;
		r.material.color = c;
	}

}


リスト5-4
public class script1 : MonoBehaviour {
	GameObject light;

	void Start () {
		light = GameObject.Find("Spotlight");
	}

	void Update () {
		transform.Rotate(new Vector3(1f, 1f, 0f));

		float x = Input.GetAxis("Horizontal");
		float z = Input.GetAxis("Vertical");
		Vector3 p = transform.position;
		p.x += x * 0.1f;
		p.z += z * 0.1f;
		transform.position = p;

		p.z -= 3f;
		Camera.main.transform.position = p;
		p.z += 3f;
		p.y = 5f;
		light.transform.position = p;
	}

	void OnTriggerEnter(Collider collider){
		Renderer r = collider.gameObject.GetComponent<Renderer>();
		Color c = r.material.color;
		c.a = 0.25f;
		r.material.color = c;
	}

	void OnTriggerExit(Collider collider){
		Renderer r = collider.gameObject.GetComponent<Renderer>();
		Color c = r.material.color;
		c.a = 1.0f;
		r.material.color = c;
	}

}


リスト5-5
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class script1 : MonoBehaviour {
	GameObject splight,cube;

	void Start () {
		splight = GameObject.Find("Spotlight");
		cube = GameObject.Find("Cube");

		Rigidbody rb = cube.GetComponent<Rigidbody>();
		rb.AddTorque(new Vector3(10f, 0, 10f));
	}

	void FixedUpdate () {

		moveCharacter();
	}

	void moveCharacter(){
		float x = Input.GetAxis("Horizontal");
		float z = Input.GetAxis("Vertical");
		Vector3 p = transform.position;

		Rigidbody rb = GetComponent<Rigidbody>();
		rb.AddForce(new Vector3(x, 0f, z));

		p.z -= 3f;
		Camera.main.transform.position = p;
		p.z += 3f;
		p.y = 5f;
		splight.transform.position = p;
	}

}


リスト5-6
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class script1 : MonoBehaviour {
	GameObject splight,cube;

	void Start () {
		splight = GameObject.Find("Spotlight");
		cube = GameObject.Find("Cube");

		Rigidbody rb = cube.GetComponent<Rigidbody>();
		rb.AddTorque(new Vector3(10f, 0, 10f));
	}

	void FixedUpdate () {

		moveCharacter();
	}

	void moveCharacter(){
		float x = Input.GetAxis("Horizontal");
		float z = Input.GetAxis("Vertical");
		Vector3 p = transform.position;

		Rigidbody rb = GetComponent<Rigidbody>();
		rb.AddForce(new Vector3(x, 0f, z));

		p.y = 1f;
		p.z -= 3f;
		Camera.main.transform.position = p;
		p.z += 3f;
		p.y = 5f;
		splight.transform.position = p;
	}

	void OnCollisionEnter(Collision collision){
		if (collision.gameObject.name == "Jimen"){
			return;
		}
		Rigidbody r = collision.gameObject.GetComponent<Rigidbody>();
		Vector3 p = transform.position;
		p.y = 0f;
		r.AddExplosionForce(100f, p, 7f);

		Rigidbody r2 = gameObject.GetComponent<Rigidbody>();
		Vector2 p2 = collision.transform.position;
		p2.y = -2f;
		r2.AddExplosionForce(500f, p2, 7f);

	}

}


リスト5-7
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Balling : MonoBehaviour {
	float dx = 0.1f; // ボールの移動量
	bool flag = true; // ゲーム中のフラグ
	bool click = false; // クリックのフラグ
	float addx = 0f; // AddForceの総量
	float addz = 0f; // AddTorqueの総量

	void Start () {
		
	}

	void Update () {
		// ゲーム中ならカメラがボールを追いかける
		if (flag){
			Vector3 p = transform.position;
			p.y += 3f;
			p.z -= 10f;
			Camera.main.transform.position = p;
		}
	}
	
	void FixedUpdate () {
		// クリックする前の処理
		if (click == false){
			moveBall();
			CheckInput();
			CheckFire();
		}
		// ゲーム終了ならボール停止
		if (flag == false){
			Rigidbody rb = gameObject.GetComponent<Rigidbody>();
			rb.angularVelocity = new Vector3(0f, 0f, 0f);
		}
	}

	// ボールを左右に往復させる処理
	void moveBall() {
		Vector3 p = transform.position;
		p.x += dx;
		if (p.x > 15 || p.x < 5){ dx *= -1f; }
		transform.position = p;
	}

	// マウスの入力をチェックしてパワーを充填
	void CheckInput() {
		addx += Input.GetAxis("Fire1");
		addz += Input.GetAxis("Fire2");
		if (addx > 100){ addx = 100f; }
		if (addz > 100){ addz = 100f; }

		Renderer r = gameObject.GetComponent<Renderer>();
		Color c = r.material.color;
		c.a = 1f - (addx / 100);
		r.material.color = c;
	}

	// 真ん中ボタンを押したらボールを投げる
	void CheckFire() {
		if (Input.GetAxis("Fire3") > 0){
			Debug.Log("FIRE!!  " + addx + "," + addz);
			Renderer r = gameObject.GetComponent<Renderer>();
			Color c = r.material.color;
			c.a = 1f;
			r.material.color = c;

			Rigidbody rb = gameObject.GetComponent<Rigidbody>();
			rb.useGravity = true;
			rb.AddForce(new Vector3(0f, 0f, addx * 100));
			rb.AddTorque(new Vector3(0f, 0f, addz * 100));
			click = true;
			addx = 0f;
			addz = 0f;
		}
	}

	// 衝突判定
	void OnCollisionEnter (Collision collision) {
		// レーンの周囲と衝突したときの処理
		if (collision.gameObject.tag == "Waku") {
			flag = false;
			RemovePin();
		}
		// ピンと衝突したときの処理
		if (collision.gameObject.tag == "Pin") {
			Behaviour bh = (Behaviour)collision.gameObject.GetComponent("Halo");
			bh.enabled = true;
			Vector3 v = collision.transform.rotation.eulerAngles;
			if ((v.x > 60 && v.x < 300) || (v.z > 60 && v.z < 300)){
				flag = false;
				RemovePin();
			}
		}
	}

	// ゲームオブジェクトから離れるときの処理
	void OnCollisionExit (Collision collision) {
		if (collision.gameObject.tag == "Pin") {
			Behaviour bh = (Behaviour)collision.gameObject.GetComponent("Halo");
			bh.enabled = false;
		}
	}

	// 倒れたピンを取り除く処理
	void RemovePin () {
		GameObject[] arr = GameObject.FindGameObjectsWithTag("Pin");
		int count = 0;
		// ピンのすべてに処理を行う
		foreach(GameObject obj in arr) {
			Rigidbody r = obj.GetComponent<Rigidbody>();
			r.freezeRotation = true;
			Vector3 v = obj.transform.rotation.eulerAngles;
			if ((v.x > 60 && v.x < 300) || (v.z > 60 && v.z < 300)){
				GameObject.Destroy(obj);
			} else {
				count++;
			}
		}
		// カメラが全体を表示するように調整
		Vector3 p = new Vector3(10f, 10f, 40f);
		Vector3 rt = new Vector3(30f, 0f, 0f);
		Camera.main.transform.position = p;
		Camera.main.transform.rotation = Quaternion.Euler(rt);
		Debug.Log("<< SCORE: " + count + " PIN STANDED. >>");
	}
}


リスト6-1
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI; // ※追加!!

public class script1 : MonoBehaviour {
	public Text text;
	GameObject splight,cube;

	void Start () {
		splight = GameObject.Find("Spotlight");
		cube = GameObject.Find("Cube");

		Rigidbody rb = cube.GetComponent<Rigidbody>();
		rb.AddTorque(new Vector3(10f, 0, 10f));
	}

	void FixedUpdate () {
		moveCharacter();
	}

	void moveCharacter(){
		float x = Input.GetAxis("Horizontal");
		float z = Input.GetAxis("Vertical");
		Vector3 p = transform.position;

		Rigidbody rb = GetComponent<Rigidbody>();
		rb.AddForce(new Vector3(x, 0f, z));

		// Textの変更
		Vector3 v = rb.velocity;
		float vx = Mathf.Floor(v.x * 100f) / 100f;
		float vz =  Mathf.Floor(v.z * 100f) / 100f;

		string msg = "X: " + vx + ", Z: " + vz;
		text.text = msg;

		// カメラとライトの移動
		p.y = 1f;
		p.z -= 3f;
		Camera.main.transform.position = p;
		p.z += 3f;
		p.y = 5f;
		splight.transform.position = p;
	}

}


リスト6-2
int count = 0;

public void OnClick() {
	text.text = "clicked!! (" + ++count + ")";
}


リスト6-3
// Textの変更
Vector3 v = rb.velocity;
float vx = Mathf.Floor(v.x * 100f) / 100f;
float vz =  Mathf.Floor(v.z * 100f) / 100f;

string msg = "X: " + vx + ", Z: " + vz;
text.text = msg;


リスト6-4
public Toggle toggle;

public void OnChecked() {
	if (toggle.isOn) {
		text.text = "Toggle is ON!";
	} else {
		text.text = "Toggle is Off...";
	}
}


リスト6-5
public void OnChecked(bool ck) {
	if (ck){
		text.text = "Toggle is ON!";
	} else {
		text.text = "Toggle is Off...";
	}
}


リスト6-6
public void OnChanged(float val) {
	text.text = "value: " + val;
}


リスト6-7
public Dropdown dd;

public void OnChanged(int val) {
	Dropdown.OptionData data = dd.options[val];
	text.text = "value: [" + val + "] " + data.text;
}


リスト6-8
public void OnChanged(string val) {
	text.color = Color.white;
	text.text = "typed: " + val;
}

public void OnEditEnd(string val) {
	text.color = Color.red;
	text.text = "「" + val + "」";
}


リスト6-9
public class script1 : MonoBehaviour {
	public GameObject splight;
	public GameObject cube;
	public Canvas canvas;

	void Start () {
		Rigidbody rb = cube.GetComponent<Rigidbody>();
		rb.AddTorque(new Vector3(10f, 0, 10f));
		canvas.enabled = false;
	}

	void FixedUpdate () {
		moveCharacter();
	}

	void moveCharacter(){
		float x = Input.GetAxis("Horizontal");
		float z = Input.GetAxis("Vertical");
		Vector3 p = transform.position;

		Rigidbody rb = GetComponent<Rigidbody>();
		rb.AddForce(new Vector3(x, 0f, z));
	}

	void OnCollisionEnter(Collision collision) {
		if (collision.gameObject.name == "jimen"){
			return;
		}
		if (collision.gameObject.name == "Cube"){
			canvas.enabled = true;
		}
	}

	public void OnClick() {
		canvas.enabled = false;
	}
		
}


リスト6-10
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class Balling : MonoBehaviour {
	// GUI関係のプロパティ
	public Canvas startCanvas;
	public Canvas setupCanvas;
	public Canvas gameCanvas;
	public Text scoreText;
	public Text msgText;
	public Text playText;

	GameObject[] pins; // ピンを保管
	Vector3[] pin_pos = new Vector3[]{ // ピンの位置
		new Vector3(10f, 3f, 46f),
		new Vector3(8f, 3f, 49),
		new Vector3(12f, 3f, 49f),
		new Vector3(6f, 3f, 52f),
		new Vector3(10f, 3f, 52),
		new Vector3(14f, 3f, 52f),
		new Vector3(4f, 3f, 55f),
		new Vector3(8f, 3f, 55f),
		new Vector3(12f, 3f, 55f),
		new Vector3(16f, 3f, 55f)
	};

	float dx = 0.1f; // ボールの移動量
	bool flag = false; // ゲーム中のフラグ
	bool play_pause = false; // ピンが倒れた後の停止フラグ
	bool click_flag = false; // クリックのフラグ
	float addx = 0f; // AddForceの総量
	float addz = 0f; // AddTorqueの総量

	int score = 0; // スコア
	int play_count = 0; // フレーム数
	bool spare = false; // スペア
	int end_count = 10; // 最大フレーム数

	void Start () {
		pins = GameObject.FindGameObjectsWithTag("Pin");
		Vector3 rt = new Vector3(30f, 0f, 0f);
		Camera.main.transform.rotation = Quaternion.Euler(rt);
	}

	void Update () {
		// ゲーム中ならカメラがボールを追いかける
		if (play_pause == false){
			Vector3 p = transform.position;
			p.y += 5f;
			p.z -= 7f;
			Camera.main.transform.position = p;
			SetCanvas();
		} else {
			if (flag){
				// 左ボタンでボールを投げる
				if (Input.GetMouseButtonDown(0)){
					play_pause = false;
					click_flag = false;
					if (spare){
						InitPin();
						InitBall();
					} else {
						Initial();
					}
				}
			}
		}
	}
	
	void FixedUpdate () {
		// ゲーム中でなければ抜ける
		if (flag == false) { return; }
		// プレイ後ならボール停止
		if (play_pause){
			Rigidbody rb = gameObject.GetComponent<Rigidbody>();
			rb.angularVelocity = new Vector3(0f, 0f, 0f);
			return;
		} else {
			if (setupCanvas.enabled){ return; }
			// クリックする前の処理
			if (click_flag == false){
				MoveBall();
				CheckFire();
			}
		}
	}

	// ゲーム開始
	public void StartGame() {
		Initial();
		flag = true;
		play_pause = false;
		startCanvas.enabled = false;
		gameCanvas.enabled = true;
		play_count = 1;
		scoreText.text = "SCORE: 0";
		playText.text = "1";
		msgText.text = "";
	}

	// 初期化
	void Initial() {
		int n = 0;
		foreach(GameObject obj in pins) {
			obj.SetActive(true);
			n++;
		}
		InitPin();
		InitBall();
		spare = false;
		playText.text = "" + play_count;
	}

	// ピンを真っ直ぐに
	void InitPin() {
		int n = 0;
		foreach(GameObject obj in pins) {
			Behaviour bh = (Behaviour)obj.gameObject.GetComponent("Halo");
			bh.enabled = false;
			Rigidbody r = obj.GetComponent<Rigidbody>();
			r.useGravity = false;
			r.isKinematic = true;
			r.freezeRotation = false;
			obj.transform.position = pin_pos[n];
			obj.transform.rotation = Quaternion.Euler(new Vector3(0f, 0f, 0f));
			r.isKinematic = false;
			r.useGravity = true;
			n++;
		}
	}

	// ボールの初期化
	void InitBall(){
		Rigidbody rb = gameObject.GetComponent<Rigidbody>();
		rb.useGravity = false;
		rb.isKinematic = true;
		transform.position = new Vector3(10f, 3f, 20f);
		rb.isKinematic = false;
		rb.useGravity = true;
	}

	// PowerCanvasのON/OFF
	void SetCanvas() {
		if (Input.GetMouseButtonDown(1)){
			setupCanvas.enabled = !setupCanvas.enabled;
		}
	}

	// ボールを左右に往復させる処理
	void MoveBall() {
		Vector3 p = transform.position;
		p.x += dx;
		if (p.x > 15 || p.x < 5){ dx *= -1f; }
		transform.position = p;
	}

	// 左ボタンでボールを投げる
	void CheckFire() {
		if (Input.GetMouseButtonDown(0)){

			Renderer r = gameObject.GetComponent<Renderer>();
			Color c = r.material.color;
			c.a = 1f;
			r.material.color = c;

			Rigidbody rb = gameObject.GetComponent<Rigidbody>();
			rb.useGravity = true;
			rb.AddForce(new Vector3(0f, 0f, addx * 100));
			rb.AddTorque(new Vector3(0f, 0f, addz * 100));
			click_flag = true;
		}
	}

	// 衝突判定
	void OnCollisionEnter (Collision collision) {
		if (play_pause){ return; }
		// レーンの周囲と衝突したときの処理
		if (collision.gameObject.tag == "Waku") {
			play_pause = false;
			RemovePin();
		}
		// ピンと衝突したときの処理
		if (collision.gameObject.tag == "Pin") {
			Behaviour bh = (Behaviour)collision.gameObject.GetComponent("Halo");
			bh.enabled = true;
			Vector3 v = collision.transform.rotation.eulerAngles;
			if ((v.x > 60 && v.x < 300) || (v.z > 60 && v.z < 300)){
				play_pause = false;
				RemovePin();
			}
		}
		if (play_count > end_count){
			GameOver();
		}
	}

	// ゲームオブジェクトから離れるときの処理
	void OnCollisionExit (Collision collision) {
		if (collision.gameObject.tag == "Pin") {
			Behaviour bh = (Behaviour)collision.gameObject.GetComponent("Halo");
			bh.enabled = false;
		}
	}

	// 倒れたピンを取り除く処理
	void RemovePin () {
		play_pause = true;
		int count = 0;
		// ピンのすべてに処理を行う
		foreach(GameObject obj in pins) {
			Rigidbody r = obj.GetComponent<Rigidbody>();
			r.freezeRotation = true;
			Vector3 v = obj.transform.rotation.eulerAngles;
			if (obj.activeInHierarchy){
				if ((v.x > 15 && v.x < 345) || (v.z > 15 && v.z < 345)){
					obj.SetActive(false);
				} else {
					count++;
				}
			}
		}
		// ２投目かチェック
		if (spare){
			spare = false;
			PlayOver();
		} else {
			if (count == 0){
				spare = false;
				PlayOver();
			} else {
				spare = true;
			}
		}
		// カメラが全体を表示するように調整
		Vector3 p = new Vector3(10f, 10f, 40f);
		Camera.main.transform.position = p;
	}

	// 投げ終わった後の処理
	void PlayOver(){
		int n = 0;
		foreach(GameObject obj in pins) {
			if (obj.activeInHierarchy == false){
				n++;
			}
		}
		if (n == 10){
			if (spare){
				n = 20;
			} else {
				n = 30;
			}
		}
		play_count++;
		score += n;
		scoreText.text = "SCORE: " + score;
	}

	// ゲーム終了時の処理
	void GameOver() {
		flag = false;
		msgText.text = "GAMEOVER";
	}

	// Weight設定
	public void SetWeight(int w) {
		Rigidbody r = gameObject.GetComponent<Rigidbody>();
		r.mass = (w + 1) * 5;
	}

	// PowerSlider設定
	public void SetPower(float p) {
		addx = p;
	}

	// SpinSlider設定
	public void SetSpin(float s) {
		addz = s;
	}
}


リスト7-1
using System.Collections;
using System.Collections.Generic;
using UnityEngine;


public class Canon : MonoBehaviour {
	public GameObject bullet; // 砲弾
	public ParticleSystem particle; //パーティクルシステム
	public Canvas title_canvas, game_canvas, finish_canvas; // GUI関係
	bool end_flag = true; // 終了フラグ
	float time_d = 10f; // 敵出現の間隔
	System.DateTime last_dt; // 最後に駅出現した時間
	Rigidbody bullet_rb; // 砲弾のリジッドボディ

	// スタート時の処理
	void Start () {
		last_dt = System.DateTime.UtcNow;
		bullet_rb = bullet.GetComponent<Rigidbody>();
	}

	// 敵出現と砲撃
	void Update () {
		if (IsFinished()){ return; }
		System.DateTime dt = System.DateTime.UtcNow;
		System.TimeSpan ts = dt - last_dt;
		if (ts.Seconds > time_d){
			CreateCube();
			last_dt = dt;
		}
		if (Input.GetKeyDown(KeyCode.Space)){
			Fire();
		}
	}

	// 入力値を元に砲台を回転
	void FixedUpdate () {
		if (IsFinished()){ return; }
		float x = Input.GetAxis("Vertical");
		float y = Input.GetAxis("Horizontal");
		Vector3 v = transform.rotation.eulerAngles;
		v.z -= x;
		v.y += y;
		if (v.z < 0) { v.z = 0; }
		transform.rotation = Quaternion.Euler(v);
	}

	// 放題に敵が接触したときの処理
	void OnTriggerEnter(Collider collider) {
		if (IsFinished()){ return; }
		if (collider.tag == "Enemy"){
			particle.transform.position = collider.transform.position;
			particle.Play();
			GameOver();
		}
	}

	// ゲーム初期化
	void Initial() {
		end_flag = false;
	}

	// 敵出現の間隔を短くする
	public void ChangeTime() {
		time_d -= 0.1f;
		if (time_d < 1f) { time_d = 1f; }
	}

	// 終了チェック
	public bool IsFinished() {
		Debug.Log(end_flag);
		return end_flag;
	}

	// スタートボタンのクリック処理
	public void OnStartBtnClick() {
		title_canvas.enabled = false;
		game_canvas.enabled = true;
		Initial();
	}

	// ゲーム終了時の処理
	public void GameOver() {
		end_flag = true;
		finish_canvas.enabled = true;
	}

	// 敵キャラの生成
	void CreateCube() {
		float rr = Random.value * 50 + 50;
		float ra = Random.value * Mathf.PI * 2;
		float rx = Mathf.Sin(ra) * rr + 250;
		float rz = Mathf.Cos(ra) * rr + 250;
		float ry = Random.value * 90 + 10;

		GameObject cube = GameObject.CreatePrimitive(PrimitiveType.Cube);
		cube.tag = "Enemy";
		cube.transform.position = new Vector3(rx, ry, rz);
		cube.transform.localScale = new Vector3(10f, 10f, 10f);

		Rigidbody rb = cube.AddComponent<Rigidbody>();
		rb.useGravity = false;
		rb.isKinematic = false;
		Renderer rd = cube.GetComponent<Renderer>();
		rd.material.color = Color.red;

		MoveCube(rb);
	}

	// 敵キャラを動かす
	void MoveCube(Rigidbody rb) {
		float tx = Random.value * 200f - 100f;
		float ty = Random.value * 600f - 300f;
		float tz = Random.value * 1000f - 500f;
		rb.AddTorque(new Vector3(tx, ty, tz));

		Vector3 p1 = transform.position;
		Vector3 p2 = rb.transform.position;
		Vector3 p3 = (p1 - p2);
		rb.AddForce(p3);
	}

	// 砲撃の処理
	void Fire() {
		bullet.transform.position = transform.position;
		bullet_rb.velocity = Vector3.zero;
		bullet_rb.angularVelocity = Vector3.zero;
		Vector3 v = transform.rotation.eulerAngles;
		float rd = (v.y + 90) *Mathf.Deg2Rad;
		float rd2 = (v.z + 10) * Mathf.Deg2Rad;
		float dx = Mathf.Sin(rd);
		float dz = Mathf.Cos(rd);
		float dy = Mathf.Sin(rd2);
		Vector3 nv = new Vector3(dx, dy, dz);
		nv *= 1000f;
		bullet_rb.useGravity = true;
		bullet_rb.AddForce(nv);
	}

}


リスト7-2
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class Bullet : MonoBehaviour {
	public Canon canonScript; // Canonのスクリプト
	public GameObject canon; // Canonオブジェクト
	public Text score; // スコアのText
	public ParticleSystem particle; // パーティクルシステム
	Rigidbody rb; // 砲弾のリジッドボディ
	int score_point = 0; // スコアの点数

	// スタート処理
	void Start () {
		rb = GetComponent<Rigidbody>();
	}
	
	// 更新処理（特にない）
	void Update () {
	}
		
	// 敵キャラの破壊
	void DestroyEnemy(Collision collision) {
		particle.Stop();
		particle.transform.position = collision.transform.position;
		particle.Play();
		GameObject.Destroy(collision.gameObject);
		ResetBullet();
		score_point += 100;
		score.text = "" + score_point;
		canonScript.ChangeTime();
	}

	// 砲弾のリセット
	public void ResetBullet() {
		rb.useGravity = false;
		Vector3 v = canon.transform.position;
		v.y = 5;
		transform.position = v;
		rb.velocity = Vector3.zero;
		rb.angularVelocity = Vector3.zero;
	}

	// 砲弾と敵キャラの衝突処理
	void OnCollisionEnter(Collision collision) {
		if (canonScript.IsFinished()){ return; }
		if (collision.gameObject.tag == "Enemy") {
			DestroyEnemy(collision);
		}
	}

}


リスト7-3
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class Roadway : MonoBehaviour {
	public float tileSize, stepSize; // タイルサイズ、ステップサイズ
	public GameObject startTile; // スタート時のタイル
	public Canvas title_canvas, game_canvas, finish_canvas, setting_canvas; // 各Canvas
	public Text countTxt, timeTxt, finishTileTxt, finishTimeTxt; // 各Text
	Rigidbody rb; // SphereのRigidbody
	GameObject here, next; // 現在と次のパネル
	System.DateTime start_dt, now_dt; // スタート時と現在の時刻
	bool end_flg,reverse_flg; // ゲーム中とリバース時を示すフラグ
	int countTile; // タイルのカウント

	// シーン開始時の処理
	void Start () {
		end_flg = true;
		reverse_flg = false;
	}

	// 更新処理
	void Update () {
		if (end_flg){ return; }

		MoveCamera(); // カメラの移動

		if (Input.GetKeyDown(KeyCode.Space)){
			rb.AddForce(new Vector3(0f, 500f, 0f)); // ジャンプ!
		}

		if (reverse_flg == false) {
			if (Input.GetKeyDown(KeyCode.Escape)) {
				Reverse(); // Escキーでリバース開始
			}
		}
	}

	// 物理エンジンの更新処理
	void FixedUpdate () {
		if (end_flg){ return; }

		MoveSphere(); // Sphereを動かす

		if (reverse_flg) {
			CheckTime(); // リバース時の処理
		} else {
			CheckHere(); // タイル作成時の処理
		}
	}

	// 初期化処理
	void Initial() {
		title_canvas.enabled = false;
		setting_canvas.enabled = true;
	}

	// ゲーム開始時の処理
	void StartGame() {
		end_flg = false;
		here = startTile;
		here.transform.localScale = new Vector3(tileSize, 1, tileSize);;
		rb = GetComponent<Rigidbody>();
		next = null;
		setting_canvas.gameObject.SetActive(false);
		game_canvas.enabled = true;
	}

	// リバース開始時の処理
	void Reverse() {
		countTile = 0;
		GameObject target;
		if (next == null){
			target = here;
		} else {
			target = next;
		}
		rb.velocity = Vector3.zero;
		rb.angularVelocity = Vector3.zero;

		reverse_flg = true;
		Renderer rr = target.GetComponent<Renderer>();
		rr.material.color = Color.red;
		start_dt = System.DateTime.UtcNow;
	}

	// メインカメラの追尾処理
	void MoveCamera() {
		Transform tr = Camera.main.transform;
		Quaternion q = Quaternion.LookRotation(transform.position - tr.position);
		tr.rotation = Quaternion.Slerp(tr.rotation ,q, 1f);
		Vector3 v = transform.position - tr.forward * 20f;
		v.y = transform.position.y + 5f;
		tr.position = v;
	}

	// GameObject（Sphere）を動かす処理
	void MoveSphere() {
		float z = Input.GetAxis("Vertical");
		float x = Input.GetAxis("Horizontal");
		Vector3 vz = Camera.main.transform.forward;
		vz *= z * 10f;
		rb.AddForce(vz);
		Vector3 vx = Camera.main.transform.right;
		vx *= x * 10f;
		rb.AddForce(vx);
	}

	// 経過時間のチェック
	void CheckTime() {
		if (reverse_flg){
			now_dt = System.DateTime.UtcNow;
			System.TimeSpan ts = now_dt - start_dt;
			timeTxt.text = "sec: " + ts.Minutes + ":" + ts.Seconds;
		}
	}

	// 現在の位置にあるタイルをチェックする
	void CheckHere() {
		float x = transform.position.x;
		float y = transform.position.y;
		float z = transform.position.z;
		float x1 = Mathf.Floor(((x - 250f) + (tileSize / 2)) / tileSize) * tileSize + 250f;
		float z1 = Mathf.Floor(((z - 250f) + (tileSize / 2)) / tileSize) * tileSize + 250f;
		float y1 = y - 2f + stepSize;
		Vector3 newHere = new Vector3(x1, y1, z1);

		bool bx = here.transform.position.x == x1;
		bool bz = here.transform.position.z == z1;
		if (bx && bz){ return; }
		if (next == null){ 
			MakeTile(newHere);
		}
	}

	// 新しいタイルの作成
	void MakeTile(Vector3 newHere) {
		GameObject cube = GameObject.CreatePrimitive(PrimitiveType.Cube);
		Vector3 sz = new Vector3(tileSize, 1, tileSize);

		cube.transform.localScale = sz;
		cube.transform.position = newHere;
		Rigidbody rb = cube.AddComponent<Rigidbody>();
		rb.velocity = Vector3.zero;
		rb.angularVelocity = Vector3.zero;
		rb.useGravity = false;
		rb.isKinematic = true;
		rb.freezeRotation = true;

		next = cube;
	}

	// スタート地点まで戻ったかチェック
	void CheckFinish(Collision collision) {
		countTxt.text = "TILE: " + ++countTile;
		if (collision.gameObject == startTile){
			end_flg = true;
			System.TimeSpan ts = now_dt - start_dt;
			finishTileTxt.text = "" + countTile;
			finishTimeTxt.text = "" + ts.Minutes + ":" + ts.Seconds +
				"." + ts.Milliseconds;
			finish_canvas.enabled = true;
		}
	}

	// タイルに触れたときの処理
	void OnCollisionEnter(Collision collision) {
		if (end_flg){ return; }
		if (collision.gameObject == next){
			here = next;
			next = null;
		}
		if (reverse_flg) {
			CheckFinish(collision);
		}
	}

	// スタートボタンの処理
	public void OnStartBtnClick() {
		Initial();
	}

	// SizeSlider操作の処理
	public void OnChangeSize(float val) {
		tileSize = val;
	}

	// StepSlider操作の処理
	public void OnChangeStep(float val) {
		stepSize = val;
	}

	// 設定画面のボタンの処理
	public void OnGoBtnClick() {
		StartGame();
	}

}


