// Start is called before the first frame update void Start() { bike = GameObject.Find("Sphere").GetComponent <Rigidbody>(); moveBike = bike.GetComponent <MoveBike>(); person = GetComponent <Rigidbody>(); personPosition = person.position; bikePosition = bike.position; bikeEntered = false; bikeExited = 0; /* * if (dir == World.Direction.North) * { * person.velocity = new Vector3(0, 0, 1); * } * else if (dir == World.Direction.South) * { * person.velocity = new Vector3(0, 0, -1); * } * else if (dir == World.Direction.East) * { * person.velocity = new Vector3(1, 0, 0); * } * else * { * person.velocity = new Vector3(-1, 0, 0); * } */ }
// Start is called before the first frame update void Start() { bike = GameObject.Find("Sphere").GetComponent <Rigidbody>(); moveBike = bike.GetComponent <MoveBike>(); person = GetComponent <Rigidbody>(); personPosition = person.position; bikePosition = bike.position; bikeEntered = false; }
/*********************************************************** * Methode: Start * Beschreibung: Initialisierung der Skriptreferenzen und * Checkboxstatus * Parameter: keine * Rückgabewert: keiner ***********************************************************/ void Start() { startPos = Bike.transform.position; startRot = Bike.transform.eulerAngles; moveBike = Bike.GetComponent<MoveBike>(); moveBikeAuto = Bike.GetComponent<AutoMove>(); bikePitch = BikeBody.GetComponent<BikePitch>(); handlebars = Handlebars.GetComponent<Handlebars>(); autoSteer = Handlebars.GetComponent<AutoSteer>(); toggleMove.isOn = moveBike.enabled; togglePitch.isOn = bikePitch.enabled; toggleHandle.isOn = handlebars.enabled; }