Esempio n. 1
0
	void Start() {
		indikatorLayer = GameObject.Find ("IndikatorLayer").GetComponent<IndikatorLayer> ();
		mountainHandler = GameObject.Find ("Map").GetComponent<MountainHandler> ();
		mainCameraHandler = gameObject.GetComponent<MainCameraHandler> ();
		allWindParticles = GameObject.Find ("Main Camera/Wind Particle System").GetComponent<AllWindParticles> ();
		ui = GameObject.Find ("UI Root").GetComponent<globalUIHandler> ();
		
		// FIXME Besser wäre: Nochmal händisch auslesen und eintragen
		for (int n = 0; n<16; n++)
			for (int i = 0; i<3; i++) {
				sourcePositions[n,i] = rotationMiddlePositions[i]-(Quaternion.Euler (0,22.5f*n,0) * new Vector3(0f, -2f,12f));
			}
		indikatorSourcePositions = sourcePositions;

		// Initial: Mittleren Berg auswählen
		changePieceTo (1);
	}
Esempio n. 2
0
	void Start() {
		mountainHandler = GameObject.Find ("Map").GetComponent<MountainHandler> ();
		mainCameraHandler = Camera.main.GetComponent<MainCameraHandler> ();
		changePiece = Camera.main.GetComponent<ChangePiece> ();
		ui = GameObject.Find ("UI Root").GetComponent<globalUIHandler> ();
	}
	void Start()
	{
		mountainHandler = GameObject.Find ("Map").GetComponent<MountainHandler> ();
		compassModel = GameObject.Find ("Compass").GetComponent<CompassModel> ();
		changePiece = gameObject.GetComponent<ChangePiece> ();
		rotationMiddle = GameObject.Find ("Main Camera").GetComponent<ChangePiece> ().rotationMiddlePositions;
		
		for (int n = 0; n<16; n++)
				for (int i = 0; i<3; i++) // calculate camera positions on leaving the compass mode
					leavingCameraPositions [n, i] = rotationMiddle [i] + (Quaternion.Euler (0, 22.5f * n, 0) * new Vector3(19.696f,3.473f,0));// x = Distance * sin(80) / sin(90); y = Distance * sin(10) / sin(90)

		Vector3 angles = transform.eulerAngles;
		rotationYAxis = angles.y;
		rotationXAxis = angles.x;
		
		// Make the rigid body not change rotation
		if(GetComponent<Rigidbody>())
		{
			GetComponent<Rigidbody>().freezeRotation = true;
		}
	}