// Use this for initialization void Start() { gameProgressTracker = levelScripts.GetComponent <GameProgressTracker>(); gameController = GameController.GetComponent <GameControllerVR>(); if (loadingSceneIndex != 0) { loadingSceneString = loadingSceneString + loadingSceneIndex.ToString(); } else { loadingSceneString = "MainMenu"; } //在这里开启一个异步任务, //进入loadScene方法。 StartCoroutine(loadScene8()); }
void Start() { gameController = GameObject.Find("GameController").GetComponent <GameControllerVR>(); ridParents = GameObject.Find("MainCamera").GetComponent <RidParents>(); // If UI text holders not provided, try to find them by names. if (pickupsCurrentText == null) { var pickupsCurrent = GameObject.Find("PickupsCurrent"); if (pickupsCurrent != null) { pickupsCurrentText = pickupsCurrent.GetComponent <Text>(); } } // If UI text holders not provided, try to find them by names. if (pickupsTotalText == null) { var pickupsTotal = GameObject.Find("PickupsTotal"); if (pickupsTotal != null) { pickupsTotalText = pickupsTotal.GetComponent <Text>(); } } // If UI text holders not provided, try to find them by names. if (pickupIconImage == null) { var pickupIcon = GameObject.Find("PickupIcon"); if (pickupIcon != null) { pickupIconImage = pickupIcon.GetComponent <Image>(); } } var pickups = GameObject.FindObjectsOfType <PickUpStar>(); _numPickupsTotal = pickups.Length; if (pickupsTotalText != null) { pickupsTotalText.text = _numPickupsTotal.ToString(); } PickUpStar.OnCollectEvent += RegisterPickup; }
// Use this for initialization void Start() { if (Application.loadedLevelName == "ZTE_1_Star") { Debug.Log(Application.loadedLevelName); destination = new Vector3(900, 1300, -1008); targetRotation = Quaternion.Euler(33, 287, 2); // targetRotation = Quaternion.Euler(33, -20, 2); } if (Application.loadedLevelName == "ZTE_2_ZTE") { Debug.Log(Application.loadedLevelName); //destination = new Vector3(900, 1300, -1008); //targetRotation = Quaternion.Euler(33, 20, 2); destination = new Vector3(2170, 1689, -721); targetRotation = Quaternion.Euler(33, 315, 349); } gameController = GameObject.Find("GameController").GetComponent <GameControllerVR>(); }