/// <summary> /// Get a new Material based on climate. /// </summary> /// <param name="key">Material key.</param> /// <param name="climate">New climate base.</param> /// <param name="season">New season.</param> /// <param name="windowStyle">New window style.</param> /// <returns>New material.</returns> public Material ChangeClimate(int key, ClimateBases climate, ClimateSeason season, WindowStyle windowStyle) { // Ready check if (!IsReady) { return(null); } // Reverse key and apply climate int archive, record, frame; ReverseTextureKey(key, out archive, out record, out frame); archive = ClimateSwaps.ApplyClimate(archive, record, climate, season); // Get new material Material material; CachedMaterial cm = GetMaterialFromCache(archive, record, out material); // Handle windows if (cm.isWindow) { ChangeWindowEmissionColor(material, windowStyle); } return(material); }
private Material GetMaterial(RuntimeMaterial runtimeMaterial, ClimateBases climate, ClimateSeason season) { int archive = runtimeMaterial.Archive; int record = runtimeMaterial.Record; if (runtimeMaterial.ApplyClimate) { archive = ClimateSwaps.ApplyClimate(archive, record, climate, season); } return(DaggerfallUnity.Instance.MaterialReader.GetMaterial(archive, record)); }
private Material GetMaterial(RuntimeMaterial runtimeMaterial, DFLocation.ClimateBaseType climateBaseType, ClimateBases climate, ClimateSeason season, int[] dungeonTextureTable) { int archive = runtimeMaterial.Archive; int record = runtimeMaterial.Record; if (dungeonTextureTable != null) archive = DungeonTextureTables.ApplyTextureTable(archive, dungeonTextureTable, climateBaseType); if (runtimeMaterial.ApplyClimate) archive = ClimateSwaps.ApplyClimate(archive, record, climate, season); return DaggerfallUnity.Instance.MaterialReader.GetMaterial(archive, record); }