Beispiel #1
0
 public void Awake()
 {
     this.buoyCounter.SetActive(false);
     this.mazeManager = FindObjectOfType<WaterMazeManager>();
     this.player = FindObjectOfType<Player>();
     Invalidate();
 }
        public void Awake()
        {
            RaycastHit hit;

            GetComponent<BoxCollider>().isTrigger = true;
            manager = FindObjectOfType<WaterMazeManager>();

            // Try and find a buoy on the left
            if (leftBuoy == null) {
                Physics.Raycast(transform.position, transform.rotation * (Vector3.left * 5), out hit);
                leftBuoy = hit.collider.GetComponent<Buoy>();
            }

            // Try and find a buoy on the right
            if (rightBuoy == null) {
                Physics.Raycast(transform.position, transform.rotation * (Vector3.right * 5), out hit);
                rightBuoy = hit.collider.GetComponent<Buoy>();
            }
        }