SkillAgentSearch skills...

AssetRegulationManager

Tool for Unity to create and run tests of Asset Regulations (texture size, number of vertices, etc.), and automate running.

Install / Use

/learn @CyberAgentGameEntertainment/AssetRegulationManager
About this skill

Quality Score

0/100

Supported Platforms

Universal

Tags

README

<p align="center"> <img width=500 src="Documentation/ARM_LOGO_color_02.png#gh-dark-mode-only" alt="Asset Regulation Manager"> <img width=500 src="Documentation/ARM_LOGO_bk.png#gh-light-mode-only" alt="Asset Regulation Manager"> </p>

ARM: Testing Unity assets automatically

license license license

Docs (English, 日本語)

Tool for Unity to create and run tests of Asset Regulations (texture size, number of vertices, etc.), and automate running.

Table of Contents

<!-- START doctoc generated TOC please keep comment here to allow auto update --> <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> <details> <summary>Details</summary> </details> <!-- END doctoc generated TOC please keep comment here to allow auto update -->

Concepts & Features

It is important to strictly manage "Asset Regulations" in Unity game development. The following items are typical examples of Asset Regulations.

  • Texture Size
  • Number of Vertices of Mesh
  • File Name

If these asset regulations are not followed or not clearly defined, the problems like below can occur.

  • Asset size increases, resulting in longer download times.
  • Asset size increases, resulting in longer load times.
  • Memory usage increases, resulting in application crashes.
  • Shader processing increases with the number of vertices, resulting in a lower frame rate.
  • Fail to load due to wrong file name.

Asset Regulation Manager allows you to test such Asset Regulations. Everyone (even non-engineers) can easily test through the intuitive interface as shown below.

<p align="center"> <img width=800 src="Documentation/concept_02.png" alt="Asset Regulation Viewer"><br> <font color="grey">Asset Regulation Viewer</font> </p>

And the command line interface (CLI) is also available for periodic automated testing.

You can create the Asset Regulation Tests easily using the GUI tool as shown below.

<p align="center"> <img width=800 src="Documentation/concept_01.png" alt="Asset Regulation Editor"><br> <font color="grey">Asset Regulation Editor</font> </p>

Setup

Requirements

This library is compatible with the following environment.

  • Unity 2019.4 or higher.

Install

To install the software, follow the steps below.

  1. Open the Package Manager from Window > Package Manager
  2. "+" button > Add package from git URL
  3. Enter the following
    • https://github.com/CyberAgentGameEntertainment/AssetRegulationManager.git?path=/Assets/AssetRegulationManager
<p align="center"> <img width=500 src="Documentation/setup_01.png" alt="Package Manager"> </p>

Or, open Packages/manifest.json and add the following to the dependencies block.

{
    "dependencies": {
        "jp.co.cyberagent.assetregulationmanager": "https://github.com/CyberAgentGameEntertainment/AssetRegulationManager.git?path=/Assets/AssetRegulationManager"
    }
}

If you want to set the target version, write as follows.

To update the version, rewrite the version as described above. If you don't want to specify a version, you can also update the version by editing the hash of this library in the Packages/package-lock.json file.

{
  "dependencies": {
      "jp.co.cyberagent.assetregulationmanager": {
      "version": "https://github.com/CyberAgentGameEntertainment/AssetRegulationManager.git?path=/Assets/AssetRegulationManager",
      "depth": 0,
      "source": "git",
      "dependencies": {},
      "hash": "..."
    }
  }
}

Note
If you get a message like No 'git' executable was found. Please install Git on your system and restart Unity, you will need to set up Git on your machine.

Create Asset Regulation Tests

Create an asset to store data

To create Asset Regulation Test, first create a Regulation Data Asset from Assets > Create > Asset Regulation Data.

<p align="center"> <img width=500 src="Documentation/editor_createasset_01.png" alt="Create Regulation Data Asset"><br> <font color="grey">Create Regulation Data Asset</font> </p>

Data regarding Asset Regaultion Tests are stored in this asset.

You can create multiple assets in your project. And you can place it anywhere you like, but do not place it in special folders such as StreamingAssets.

Create Asset Regulations

Next, double-click on a regulation data asset or press the Open Editor button from the Inspector to open the Asset Regulation Editor. Then press the + button in the upper left corner of this window to create a new asset regulation.

<p align="center"> <img width=700 src="Documentation/editor_createregulation_01.png" alt="Create Asset Regulation"><br> <font color="grey">Create Asset Regulation</font> </p>

One asset regulation consists of the following two elements.

<u>Target</u>

  • Assets to which this regulation applies.
  • Specify like "All Texture2D type assets in the Character folder".

<u>Constraint</u>

  • Constraint that the target assets must adhere to.
  • "Texture Size must be 1024x1024 or smaller", "Texture format must be ASTC4x4", etc.

The next step is to set these up.

Set up targets

To set up a target, first click the Add Asset Group button on the Targets tab in the right panel. You will see a new Asset Group named New Asset Group.

<p align="center"> <img width=700 src="Documentation/editor_target_01.png" alt="Create Asset Group"><br> <font color="grey">Create Asset Group</font> </p>

You can specify the target assets by adding Asset Filters to this asset group. For example, to target only the assets in the Characters folder, press the + button to the right of the asset group name and select Object Filter from the menu. And assign the Characters folder to the Object property of the added Object Filter.

<p align="center"> <img width=700 src="Documentation/editor_target_02.png" alt="Create Object Filter"><br> <font color="grey">Create Object Filter</font> </p>

Next, narrow down the targets to Texture2D type assets only. Press the + button as before and add Type Filter. And set Texture2D to the Type property of the added Type Filter.

<p align="center"> <img width=700 src="Documentation/editor_target_03.png" alt="Create Type Filter"><br> <font color="grey">Create Type Filter</font> </p>

Now, you can target all Texture2D under the Characters folder.

Note that multiple asset groups can be set Up for a single asset regulation. If multiple asset groups are set up, all assets indicated by each asset group will be targets. The figure below shows an example of targeting of all Texture2D files in the Characters folder and all files with the exr extension in the CharacterHDR folder.

<p align="center"> <img width=700 src="Documentation/editor_target_04.png" alt="Multiple Asset Groups"><br> <font color="grey">Multiple Asset Groups</font> </p>

Set up constraints

Next, set up constraints. First, create a constraint regarding max texture size. Select Add Constraint > Texture > Max Texture Size from the Constraints tab in the right panel.

<p align="center"> <img width=700 src="Documentation/editor_constraint_01.png" alt="Max Texture Size"><br> <font color="grey">Max Texture Size</font> </p>

Enter the maximum size of the texture in the Max Size property of the added constraint and you are done.

<p align="center"> <img width=700 src="Documentation/editor_constraint_02.png" alt="Max Size"><br> <font color="grey">Max Size</font> </p>

In addition, add a constraint regarding texture format.
As before, select Add Constraint > Texture > Texture Format to add the constraint. This time, set Target to iOS and Format to ASTC_6x6.

<p align="center"> <img width=700 src="Documentation/editor_constraint_03.png" alt="Texture Format"><br> <font color="grey">Texture Format</font> </p>

You have now set the constraint.

Details on how to use the Asset Regulation Editor

The Asset Regulation Editor also supports the following operations.

Related Skills

View on GitHub
GitHub Stars294
CategoryDevelopment
Updated6d ago
Forks16

Languages

C#

Security Score

95/100

Audited on Mar 25, 2026

No findings