void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } }
IEnumerator DownloadTexture() { Firebase.Storage.StorageReference texture_ref = GetStorageReference().Child(textureFIleName); // Fetch the download URL var task = texture_ref.GetDownloadUrlAsync(); yield return(new WaitUntil(() => task.IsCompleted)); using (WWW www = CachedDownloader.GetCachedWWW(task.Result.ToString())) { yield return(www); Renderer renderer = cube.GetComponent <Renderer>(); renderer.material.mainTexture = www.texture; } }
// Use this for initialization void Awake() { Instance = this; }