Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.SceneManagement;
- namespace HoloToolkit.Unity
- {
- public class StickToCamera : MonoBehaviour {
- GameObject theentrance;
- public GameObject[] CurrentLocation;
- public GameObject markerfolderlocation;
- public GameObject[] CurrentMarker;
- public GameObject turnoffShortCut;
- // Use this for initialization
- void Start() {
- this.transform.parent = GameObject.Find("MixedRealityCamera").transform;
- theentrance = GameObject.Find("TheEntrance");
- }
- // Update is called once per frame
- void Update() {
- if (theentrance == null)
- {
- Destroy(this.gameObject);
- }
- for (int i = 0; i < CurrentLocation.Length; i++)
- {
- CurrentMarker[i] = markerfolderlocation.transform.GetChild(i).gameObject;
- if (CurrentLocation[i].activeSelf == true)
- {
- CurrentMarker[i].SetActive(true);
- }
- else
- {
- CurrentMarker[i].SetActive(false);
- CurrentLocation[i].SetActive(false);
- }
- }
- this.transform.SetParent(GameObject.Find("MixedRealityCamera").transform);
- this.transform.localPosition = new Vector3(0, 0, 2.5f);
- this.transform.rotation = GameObject.Find("MixedRealityCamera").transform.rotation;
- // this.transform.LookAt(-GameObject.Find("MixedRealityCamera").transform.position);
- }
- public void ShutOfOtherLocations()
- {
- turnoffShortCut.GetComponent<TurnCanvasOff>().j = 2;
- for (int j = 0; j < CurrentLocation.Length; j++)
- {
- CurrentLocation[j].SetActive(false);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement