public override void SetLoaderObject(LoaderObject loader) { this.filePath = loader.GetFilePath(); imageLoader = loader as ImageLoaderObject; if (imageLoader == null) { Debug.LogError("Loader for " + this.filePath + " is not an ImageLoaderObject"); } }
protected override void DoUpdate() { if (imageLoader != null) { if (imageLoader.IsLoaded()) { this.SetTexture2D(imageLoader.GetTexture()); imageLoader = null; LocalMediaReady(); } } }
/// Give an existing GameObject an icImageMaterial with a given image file. public icImageMaterial CreateImageMaterial(string filePath, GameObject go) { icImageMaterial mat = go.GetComponent<icImageMaterial>(); if (mat == null) mat = go.AddComponent<icImageMaterial>(); ImageLoaderObject lo = new ImageLoaderObject(filePath, this.threadedLoader); mat.SetLoaderObject(lo); this.threadedLoader.AddLoaderInfo(lo); return mat; }
/// Give an existing GameObject an icImageMaterial with a given image file. public icImageMaterial CreateImageMaterial(string filePath, GameObject go) { icImageMaterial mat = go.GetComponent <icImageMaterial>(); if (mat == null) { mat = go.AddComponent <icImageMaterial>(); } ImageLoaderObject lo = new ImageLoaderObject(filePath, this.threadedLoader); mat.SetLoaderObject(lo); this.threadedLoader.AddLoaderInfo(lo); return(mat); }