C# Addendum
The code in this chapter represents another straightforward C# port. Here it is:
HeroShipCSharp.cs
using UnityEngine; using System.Collections; public class HeroShipCSharp : MonoBehaviour { public GameObject bullet; public AudioClip pew; private void Update() { transform.position = new Vector3(Input.mousePosition.x/20, transform.position.y, transform.position.z); if(Input.GetMouseButtonDown(0)) { audio.PlayOneShot(pew); Instantiate(bullet, transform.position + new Vector3(-3,2,0), Quaternion.identity); Instantiate(bullet, transform.position + new Vector3(3,2,0), Quaternion.identity); } } }
EnemyShipCSharp.cs
using UnityEngine; using System.Collections; public class EnemyShipCSharp : MonoBehaviour { public GameObject explosion; public int speed; public AudioClip[] audioClips; private void Update () { transform.position = new Vector3(transform.position.x, transform...