// Use this for initialization void Start() { cam = GameObject.Find ("Main Camera"); cPos = cam.GetComponent<CameraFollow2> (); bar1.SetActive (false); bar2.SetActive (false); bar3.SetActive (false); wave = 0; delay = 0f; }
// Finding necessary scripts and setting base variables void Start() { bounceScript = bounceContainer.GetComponent<VisGameObjectPropertyTrigger> (); cameraScript = camera.GetComponent<CameraFollow2> (); stopPointLeft = originPoint.transform.localPosition.x - buffer; stopPointRight = originPoint.transform.localPosition.x + buffer; zoomStopPointLeft = originPoint.transform.localPosition.x - zoomBuffer; zoomStopPointRight = originPoint.transform.localPosition.x + zoomBuffer; buildingStopPoingLeft = originPoint.transform.localPosition.x - buildingBuffer; buildingStopPointRight = originPoint.transform.localPosition.x + buildingBuffer; }
private void OnTriggerEnter(Collider other) { if (other.gameObject.name == "Watermelon (1)") { p = 1; cf1 = GameObject.FindObjectOfType <CameraFollow1>(); cf1.StopFollowing(); } if (other.gameObject.name == "Watermelon (2)") { p = 2; cf2 = GameObject.FindObjectOfType <CameraFollow2>(); cf2.StopFollowing(); } //tämä muutettuna intiksi other.gameObject.name gm = GameObject.FindObjectOfType <GameManager>(); gm.Finished(p); }
// Use this for initialization void Start () { cam = GameObject.Find ("Main Camera"); camPos = cam.GetComponent<CameraFollow2> (); }