September 2013
Beginner
292 pages
6h 19m
English
using UnityEngine; using System.Collections; public class PlayerControl : MonoBehaviour { public float setupSpinSpeed = 50.0f; public float speed = 16.0f; public float rotationSpeed = 0.60f; public float hoverPower = 3.5f; public Rigidbody projectile; public Color red = Color.red; public Color blue = Color.blue; public Color green = Color.green; public Color yellow = Color.yellow; public Color white = Color.white; private GameData gameDataRef; void Start () { gameDataRef = GameObject.Find("GameManager").GetComponent<GameData>(); } void FixedUpdate() { float foreAndAft = Input.GetAxis ("Vertical") * speed; float rotation = Input.GetAxis ("Horizontal") * rotationSpeed; rigidbody.AddRelativeForce (0, 0, foreAndAft); rigidbody.AddTorque ...