// Use this for initialization void Start() { mLoadingCanvas = GameObject.Find("LoadingCanvas").GetComponent <LoadingCanvas>(); OpenUIMain(); InDoorSceneCtrl.Instance.LoadScenes(mInDoorList, 0); }
public void Awake() { if (Instance == null) { Instance = this; } DontDestroyOnLoad(this); }
/// <summary> /// Reload scene to another one with loading screen. /// </summary> /// <param name="sceneIndex">Scene index to be loaded.</param> public void LoadScene(int sceneIndex) { if (_loadingCanvas == null) { _loadingCanvas = Instantiate(_loadingCanvasPrefab, transform.position, Quaternion.identity).GetComponent <LoadingCanvas>(); } StartCoroutine(LoadAsynchronously(sceneIndex)); }
private void Awake() { if (loadingCanvas == null) { loadingCanvas = this; DontDestroyOnLoad(this); //The master lives while the game runs } else { DestroyImmediate(this); } }
public ExternalGameManager(LoadingCanvas loadingCanvas) { _loadingCanvas = loadingCanvas; _dirPath = Path.Combine( Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), _GAME_DIR_NAME); GamesInfo = new List <GameInfo>(); if (!SaveDirExists()) { CreateGameDir(); } GamesInfo = GetStoredGamesInfo(); }
private void Awake() { //Check if there is already an instance of SoundManager if (instance == null) { //if not, set it to this. instance = this; } //If instance already exists: else if (instance != this) { //Destroy this, this enforces our singleton pattern so there can only be one instance of SoundManager. Destroy(gameObject); } //Set SoundManager to DontDestroyOnLoad so that it won't be destroyed when reloading our scene. DontDestroyOnLoad(gameObject); }
void Awake() { if (instance == null) { instance = this; DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } //Get references to components blockingPanel = transform.Find(BLOCKING_PANEL_NAME).GetComponent <Image>();; text = transform.Find("Text").GetComponent <ColorFader>(); image = transform.Find("Black Screen").GetComponent <ColorFader>(); }
void OnLevelFinishedLoading(Scene scene, LoadSceneMode mode) { if (scene.name == "login") { lc = GameObject.FindObjectOfType <LoadingCanvas>(); //Find the loading canvas usernameField = GameObject.Find("Username Input").GetComponent <InputField>(); passwordField = GameObject.Find("Password Input").GetComponent <InputField>(); usernameStatus = GameObject.Find("Username Status").GetComponent <Text>(); //LOCAL_DATA_ROOT_PATH = Application.persistentDataPath.ToString() + "/_data/"; LOCAL_DATA_ROOT_PATH = Accessories.LOCAL_DATA_ROOT_PATH; REGISTERED_USERS_FILE_PATH = Accessories.REGISTERED_USERS_FILE_PATH; WEB_DATA_ROOT_PATH = Accessories.WEB_DATA_ROOT_PATH; CURRENT_CREDENTIALS_FILE_PATH = Accessories.CURRENT_CREDENTIALS_FILE_PATH; REGISTER_URL_LINK = Accessories.REGISTER_URL_LINK; StartCoroutine(initialize()); //Attempt to download a list of the registered users and write it to a local file } }
// Use this for initialization void Start() { mLoadingCanvas = GameObject.Find("LoadingCanvas").GetComponent <LoadingCanvas>(); OpenUIMain(); }
public void GoToMainMenu() { LoadingCanvas.SetActive(true); StartCoroutine(LoadAsynchronously("MainMenu")); }