public Texture2DHolder(string path, ResourceManager.LoadingType type) { loaded = true; this.type = type; switch (type) { case ResourceManager.LoadingType.ResourcesLoad: this.path = path; tex = LoadTexture(); break; case ResourceManager.LoadingType.SystemIO: this.path = path; this.fileData = LoadBytes(this.path); if (this.fileData == null) { this.fileData = LoadBytes(this.path); if (this.fileData == null) { loaded = false; Debug.Log("No se pudo cargar: " + this.path); } } break; } }
public Texture2DHolder(string path, ResourceManager.LoadingType type) { loaded = true; this.type = type; switch (type) { case ResourceManager.LoadingType.RESOURCES_LOAD: this.path = path; tex = LoadTexture(); break; case ResourceManager.LoadingType.SYSTEM_IO: this.path = path; this.fileData = LoadBytes(this.path); if (this.fileData == null) { Regex pattern = new Regex("[óñ]"); this.path = pattern.Replace(this.path, "+¦"); this.fileData = LoadBytes(this.path); if (this.fileData == null) { loaded = false; Debug.Log("No se pudo cargar: " + this.path); } } break; } }
public eAnim(string path, ResourceManager.LoadingType type) { frames = new List <eFrame> (); Regex pattern = new Regex("[óñ]"); this.path = pattern.Replace(path, "+¦"); string[] splitted = path.Split('.'); if (splitted [splitted.Length - 1] == "eaa") { string eaaText = ""; switch (ResourceManager.Instance.getLoadingType()) { case ResourceManager.LoadingType.SYSTEM_IO: eaaText = System.IO.File.ReadAllText(path); break; case ResourceManager.LoadingType.RESOURCES_LOAD: TextAsset ta = Resources.Load(path) as TextAsset; if (ta != null) { eaaText = ta.text; } break; } parseEea(eaaText); } else { createOldMethod(); } }
public Texture2DHolder(string path, ResourceManager.LoadingType type) { loaded = true; this.type = type; switch (type) { case ResourceManager.LoadingType.RESOURCES_LOAD: this.path = path; tex = LoadTexture (); break; case ResourceManager.LoadingType.SYSTEM_IO: this.path = path; this.fileData = LoadBytes (this.path); if (this.fileData == null) { Regex pattern = new Regex ("[óñ]"); this.path = pattern.Replace (this.path, "+¦"); this.fileData = LoadBytes (this.path); if (this.fileData == null) { loaded = false; Debug.Log ("No se pudo cargar: " + this.path); } } break; } }
public eAnim(string path, ResourceManager.LoadingType type) { frames = new List <eFrame>(); var incidences = new List <Incidence>(); Animation = Loader.LoadAnimation(path, Game.Instance.ResourceManager, incidences); foreach (var frame in Animation.getFrames()) { var eframe = new eFrame(); eframe.Image = Game.Instance.ResourceManager.getImage(frame.getUri()); eframe.Duration = (int)frame.getTime(); frames.Add(eframe); } }
// ################################################## // ################## CONSTRUCTORS ################## // ################################################## public MovieHolder(string path, ResourceManager.LoadingType type) { this.type = type; var videoPlayerHolder = new GameObject("VideoPlayer-" + System.IO.Path.GetFileNameWithoutExtension(path)); videoPlayer = videoPlayerHolder.AddComponent <VideoPlayer>(); videoPlayer.playOnAwake = false; videoPlayer.renderMode = VideoRenderMode.RenderTexture; videoPlayer.aspectRatio = VideoAspectRatio.FitInside; videoPlayer.audioOutputMode = VideoAudioOutputMode.Direct; videoPlayer.errorReceived += VideoPlayer_errorReceived; this.path = path; LoadVideo(); }
public AudioHolder(string path, ResourceManager.LoadingType type) { loaded = true; switch (type) { case ResourceManager.LoadingType.RESOURCES_LOAD: audioClip = LoadAudio(path, type); break; case ResourceManager.LoadingType.SYSTEM_IO: Debug.LogError("Not yet implemented"); break; } if (audioClip) { loaded = true; } }
// ################################################## // ################## CONSTRUCTORS ################## // ################################################## public MovieHolder(string path, ResourceManager.LoadingType type) { loaded = true; this.path = path; #if UNITY_WEBPLAYER || UNITY_WEBGL LoadFromWebGL(path); #elif UNITY_ANDROID || UNITY_IPHONE #else switch (type) { case ResourceManager.LoadingType.RESOURCES_LOAD: LoadFromResources(path); break; case ResourceManager.LoadingType.SYSTEM_IO: Game.Instance.StartCoroutine(LoadFromSystem(path)); break; } #endif }
private static AudioClip LoadAudio(string path, ResourceManager.LoadingType type) { AudioClip loadedClip = null; switch (type) { case ResourceManager.LoadingType.RESOURCES_LOAD: loadedClip = Resources.Load <AudioClip>(path); if (loadedClip == null) { Debug.Log("Couldn't load: " + path); } break; case ResourceManager.LoadingType.SYSTEM_IO: Debug.LogError("Not yet implemented"); break; } return(loadedClip); }
public static ResourceManager CreateLocal(string resourcesFolder = "CurrentGame/", ResourceManager.LoadingType loadingType = ResourceManager.LoadingType.ResourcesLoad) { var resourceManager = new ResourceManager(loadingType); if (loadingType == ResourceManager.LoadingType.SystemIO) { resourceManager.Path = resourceManager.getCurrentDirectory() + resourcesFolder; } else { resourceManager.Path = resourcesFolder; } return(resourceManager); }
public Texture2DHolder(string path, ResourceManager.LoadingType type) { this.type = type; this.path = path; }