void Awake() { // Make sure the menu is singleton if (singleton == null) { singleton = this; DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } }
public void Awake() { Singleton = GameObject.FindWithTag("Singleton").GetComponent <SingletonControl>(); MainCamera = Singleton.Camera.GetComponent <Camera>().gameObject; MarkerEnvironment = Singleton.Environment; foreach (GameObject Object in CameraObject) { Object.transform.SetParent(MainCamera.transform); Object.transform.localPosition = Vector3.zero; Object.transform.localRotation = Quaternion.identity; } foreach (GameObject Object in SceneObject) { Object.transform.SetParent(Singleton.Environment.transform); } }