Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Source/TexturesUnlimited/Addon/TexturesUnlimitedLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
//works, but needs alternate render
alternateRender = true;
}
else if (graphicsAPI == UnityEngine.Rendering.GraphicsDeviceType.Direct3D9)

Check warning on line 170 in Source/TexturesUnlimited/Addon/TexturesUnlimitedLoader.cs

View workflow job for this annotation

GitHub Actions / build / build

'GraphicsDeviceType.Direct3D9' is obsolete: 'Direct3D 9 is no longer supported in Unity 2017.2+'
{
//has issues -- display warning, and needs alternate render
alternateRender = true;
Expand Down Expand Up @@ -220,7 +220,7 @@
// and must be loaded using a WWW reference; you cannot use the
// AssetBundle.CreateFromFile/LoadFromFile methods unless you
// manually compiled your bundles for stand-alone use
WWW www = CreateWWW(assetBundleName);

Check warning on line 223 in Source/TexturesUnlimited/Addon/TexturesUnlimitedLoader.cs

View workflow job for this annotation

GitHub Actions / build / build

'WWW' is obsolete: 'Use UnityWebRequest, a fully featured replacement which is more efficient and has additional features'

if (!string.IsNullOrEmpty(www.error))
{
Expand Down Expand Up @@ -319,12 +319,12 @@
/// </summary>
/// <param name="bundlePath"></param>
/// <returns></returns>
private static WWW CreateWWW(string bundlePath)

Check warning on line 322 in Source/TexturesUnlimited/Addon/TexturesUnlimitedLoader.cs

View workflow job for this annotation

GitHub Actions / build / build

'WWW' is obsolete: 'Use UnityWebRequest, a fully featured replacement which is more efficient and has additional features'
{
try
{
string name = Application.platform == RuntimePlatform.WindowsPlayer ? "file:///" + bundlePath : "file://" + bundlePath;
return new WWW(Uri.EscapeUriString(name));

Check warning on line 327 in Source/TexturesUnlimited/Addon/TexturesUnlimitedLoader.cs

View workflow job for this annotation

GitHub Actions / build / build

'WWW' is obsolete: 'Use UnityWebRequest, a fully featured replacement which is more efficient and has additional features'
}
catch (Exception e)
{
Expand Down Expand Up @@ -797,7 +797,7 @@

public RecoloringData getRecoloringData()
{
return new RecoloringData(color, specular, metallic, 1);
return new RecoloringData(color, specular, metallic, detail);
}
}

Expand Down
2 changes: 1 addition & 1 deletion Source/TexturesUnlimited/GUI/CraftRecolorGUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ private void drawPresetColorArea()
bStr = (editingColor.color.b * 255f).ToString("F0");
aStr = (editingColor.specular * 255f).ToString("F0");
mStr = (editingColor.metallic * 255f).ToString("F0");
//dStr = (editingColor.detail * 100f).ToString("F0");//leave detail mult as pre-specified value (user/config); it does not pull from preset colors at all
dStr = (editingColor.detail * 100f).ToString("F0");
update = true;
}
GUI.color = old;
Expand Down
7 changes: 7 additions & 0 deletions Source/TexturesUnlimited/Util/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,13 @@ public static Color GetColor(this ConfigNode node, string name)
public static float GetColorChannelValue(this ConfigNode node, string name)
{
string value = node.GetStringValue(name).Trim();

// Detail was not included in presets originally, so on old presets GetStringValue will return "", which will default to 0.
// Default to 1 instead if trying to access detail, which results in a default detail of 100, as before.

if (value == "" && name == "detail")
return 1f;

float floatValue = safeParseFloat(value);
if (value.Contains(".")) { return floatValue; }
if (name == "detail") { return floatValue / 100; }
Expand Down
Loading