Skip to content

Commit

Permalink
Release 11.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
UnityAidas committed Nov 14, 2023
1 parent d0efcc7 commit f1e1a74
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 13 deletions.
9 changes: 9 additions & 0 deletions com.unity.asset-store-tools/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
# Changelog
All notable changes to this package will be documented in this file.

## [11.2.2] - 2023-02-23

### Validator Changes

- Updated the 'LOD Setup' test to address some issues
- Added additional checks for LOD renderers (inactive renderer check, LOD Group reference check, relative hierarchy position to LOD Group check)
- LOD Group Component is no longer required to be on the root of the Prefab
- Updated the test result message interface when invalid Prefabs are found

## [11.2.1] - 2023-01-17

### Uploader Changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ namespace AssetStoreTools.Uploader
/// </summary>
internal static class AssetStoreAPI
{
public const string ToolVersion = "V6.2.1";
public const string ToolVersion = "V6.2.2";

private const string UnauthSessionId = "26c4202eb475d02864b40827dfff11a14657aa41";
private const string KharmaSessionId = "kharma.sessionid";
private const int UploadResponseTimeoutMs = 10000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -938,19 +938,23 @@ public TestResult _17_CheckLODsonyourPrefabs()
};

var prefabs = GetObjectsFromAssets(FileType.Prefab);
var badPrefabs = new List<GameObject>();
var badPrefabs = new Dictionary<GameObject, List<MeshFilter>>();

foreach (var o in prefabs)
{
var p = (GameObject)o;
var meshFilters = p.GetComponentsInChildren<MeshFilter>();
var hasLODGroup = p.TryGetComponent<LODGroup>(out _);
var meshFilters = p.GetComponentsInChildren<MeshFilter>(true);
var badMeshFilters = new List<MeshFilter>();
var lodGroups = p.GetComponentsInChildren<LODGroup>(true);

foreach (MeshFilter mf in meshFilters)
foreach (var mf in meshFilters)
{
if (mf.name.Contains("LOD") && !hasLODGroup)
badPrefabs.Add(p);
if (mf.name.Contains("LOD") && !IsPartOfLodGroup(mf, lodGroups))
badMeshFilters.Add(mf);
}

if (badMeshFilters.Count > 0)
badPrefabs.Add(p, badMeshFilters);
}

if (badPrefabs.Count <= 0)
Expand All @@ -960,11 +964,32 @@ public TestResult _17_CheckLODsonyourPrefabs()
}

result.Result = TestResult.ResultStatus.Warning;
result.AddMessage("The following prefabs do not meet the LOD requirements", null, badPrefabs.ToArray());
result.AddMessage("The following prefabs do not meet the LOD requirements");

foreach (var p in badPrefabs)
{
var resultList = new List<Object>();
resultList.Add(p.Key);
resultList.AddRange(p.Value);
result.AddMessage($"{p.Key.name}.prefab", new MessageActionOpenAsset(p.Key), resultList.ToArray());
}

return result;
}

private bool IsPartOfLodGroup(MeshFilter mf, LODGroup[] lodGroups)
{
foreach(var lodGroup in lodGroups)
{
// If MeshFilter is a child/deep child of a LodGroup AND is referenced in this LOD group - it is valid
if (mf.transform.IsChildOf(lodGroup.transform) &&
lodGroup.GetLODs().Any(lod => lod.renderers.Any(renderer => renderer != null && renderer.gameObject == mf.gameObject)))
return true;
}

return false;
}

#endregion

#region 18_ShaderCompilerErrors
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@ MonoBehaviour:
HasBeenInitialized: 1
Id: 17
Title: LOD setup
Description: "We do not allow prefabs that contain a mesh with LOD written in\r
its name, but without an LOD element or more than 1 mesh attached. Please\r make
sure that LODs are correctly set up in the prefab. Refer to the LODGroup\r Manual
to set up your LODs."
Description: 'Prefabs containing meshes with ''LOD'' in their name must meet the
following requirements:
- LOD Mesh must be referenced by an LOD Group Component
-
LOD Mesh GameObject must be a child of an LOD Group Component'
TestMethodName: _17_CheckLODsonyourPrefabs
ErrorCategory:
Filter:
Expand Down
2 changes: 1 addition & 1 deletion com.unity.asset-store-tools/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "com.unity.asset-store-tools",
"displayName": "Asset Store Tools",
"version": "11.2.1",
"version": "11.2.2",
"unity": "2019.4",
"description": "Whether you're a programmer, game designer, texture artist or 3D modeler, you're welcome to share your creations with everybody in the Unity developer community!",
"type": "tool"
Expand Down

0 comments on commit f1e1a74

Please sign in to comment.