void Start() { prefabCharacter = MapManager.prefab; arOrigin = FindObjectOfType <ARSessionOrigin>(); arRayCastManager = FindObjectOfType <ARRaycastManager>(); camera = arOrigin.GetComponentInChildren <Camera>(); screenCenter = camera.ViewportToScreenPoint(new Vector3(.5f, .5f)); animatorScript = GetComponent <AnimatorScript>(); if (isBossFight) { animatorScript.animator = prefabBoss.GetComponent <Animator>(); } else { animatorScript.animator = prefabCharacter.GetComponent <Animator>(); } InvokeRepeating("UpdateNavMesh", .5f, .5f); if (Application.isEditor) { meshSurface = Instantiate(editorObject, new Vector3(0, -.5f, 1), Quaternion.identity); StartCoroutine("SpawnGround"); CancelInvoke("UpdateNavMesh"); } removeKolo = false; }
void Awake() { Instance = this; arCamera = ARSessionOrigin.GetComponentInChildren <Camera>(); if (arCamera == null) { arCamera = Camera.main; } savedCameraNear = arCamera.nearClipPlane; savedCameraFar = arCamera.farClipPlane; }
void Start() { arRaycastManager = arSessionOrigin.GetComponent <ARRaycastManager>(); cameraOrigin = arSessionOrigin.GetComponentInChildren <Camera>(); }