Copy assets at given paths and store them at new paths. Refreshes the AssetDatabase at the end. Use 'assets-find' to locate the source assets first.
日本語の概要は準備中です。原文の説明を表示しています。
Split a C# file into Unity 6.5+ and pre-Unity 6.5 variants. Use when a file needs different implementations for different Unity versions due to API changes (e.g., EntityId vs int, GetEntityId vs GetInstanceID).
インストール方法を見るインストールする前に、エージェントに与えられる指示の中身を確認できます。
Split a C# source file into two variants: one for Unity 6.5+ (UNITY_6000_5_OR_NEWER) and one for older versions (pre-Unity 6.5).
Unity 6.5 introduced breaking changes including:
EntityId replaces int for instance IDs (GetEntityId() replaces GetInstanceID())EditorUtility.EntityIdToObject(EntityId) replaces EditorUtility.InstanceIDToObject(int)EntityId <-> int conversions are marked [Obsolete(..., true)] (compile error)When a file needs different code for these Unity versions, split it into two files following the project convention.
| File | Purpose | Preprocessor Guard |
|---|---|---|
FileName.cs | Unity 6.5+ (newer version) | #if UNITY_6000_5_OR_NEWER |
FileName.pre-Unity.6.5.cs | Pre-Unity 6.5 (older version) | #if !UNITY_6000_5_OR_NEWER |
For files that also have Editor/Runtime variants, combine the guards:
| File | Guard |
|---|---|
FileName.Editor.cs | #if UNITY_EDITOR && UNITY_6000_5_OR_NEWER |
FileName.Editor.pre-Unity.6.5.cs | #if UNITY_EDITOR && !UNITY_6000_5_OR_NEWER |
FileName.Runtime.cs | #if !UNITY_EDITOR && UNITY_6000_5_OR_NEWER |
FileName.Runtime.pre-Unity.6.5.cs | #if !UNITY_EDITOR && !UNITY_6000_5_OR_NEWER |
Read $ARGUMENTS (the target file path). Identify which parts need version-specific code.
Common differences between Unity 6.5+ and pre-6.5:
| Unity 6.5+ | Pre-Unity 6.5 |
|---|---|
EntityId | int |
EntityId.None | 0 |
go.GetEntityId() | go.GetInstanceID() |
EditorUtility.EntityIdToObject(entityId) | EditorUtility.InstanceIDToObject(instanceID) |
ObjectRef.InstanceID is EntityId | ObjectRef.InstanceID is int? |
Update the original .cs file to contain only the Unity 6.5+ version:
UNITY_6000_5_OR_NEWEREntityId, GetEntityId(), etc.Create the .pre-Unity.6.5.cs file with the pre-6.5 version:
!UNITY_6000_5_OR_NEWERint, GetInstanceID(), etc.Both files must:
#nullable enable#endif matching the opening #ifRun assets-refresh tool to let Unity generate .meta files and recompile.
IMPORTANT: Do NOT manually create .meta files. Unity auto-generates them after assets-refresh or any AssetDatabase.Refresh() call.
Check for compilation errors using console-get-logs tool.
Given GameObjectUtils.Runtime.cs with #if !UNITY_EDITOR that uses both EntityId and int with #if UNITY_6000_5_OR_NEWER inside:
Before (single file with nested #if):
#if !UNITY_EDITOR
// ...
#if UNITY_6000_5_OR_NEWER
public static GameObject? FindByInstanceID(EntityId instanceID) { ... }
#else
public static GameObject? FindByInstanceID(int instanceID) { ... }
#endif
#endif
After (two clean files):
GameObjectUtils.Runtime.cs:
#if !UNITY_EDITOR && UNITY_6000_5_OR_NEWER
// ...
public static GameObject? FindByInstanceID(EntityId instanceID) { ... }
#endif
GameObjectUtils.Runtime.pre-Unity.6.5.cs:
#if !UNITY_EDITOR && !UNITY_6000_5_OR_NEWER
// ...
public static GameObject? FindByInstanceID(int instanceID) { ... }
#endif
Existing examples of this pattern in the codebase:
Runtime/Data/ObjectRef.cs / ObjectRef.pre-Unity.6.5.csRuntime/Data/GameObjectRef.cs / GameObjectRef.pre-Unity.6.5.csRuntime/Utils/GameObjectUtils.Editor.cs / GameObjectUtils.Editor.pre-Unity.6.5.csTests/Editor/Tool/Assets/AssetsPrefabCreateTests.cs / AssetsPrefabCreateTests.pre-Unity.6.5.csまだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
Copy assets at given paths and store them at new paths. Refreshes the AssetDatabase at the end. Use 'assets-find' to locate the source assets first.
日本語の概要は準備中です。原文の説明を表示しています。
Create a new folder under a parent folder inside 'Assets/'. The parent path must start with 'Assets/' and every intermediate folder in it must already exist. Refreshes the AssetDatabase at the end and returns the GUID(s) of the created folder(s).
日本語の概要は準備中です。原文の説明を表示しています。
Delete the assets at the given project paths. Refreshes the AssetDatabase at the end. Use 'assets-find' to locate the assets first.
日本語の概要は準備中です。原文の説明を表示しています。
Search the Unity asset database using a search filter string. The filter accepts names, labels (`l:`), types (`t:`), AssetBundles (`b:`), areas (`a:`), and globs (`glob:`). See the body for the full filter syntax.
日本語の概要は準備中です。原文の説明を表示しています。
Search the built-in assets of the Unity Editor (located at Resources/unity_builtin_extra). Filters by name and/or type; built-in assets have no GUID so GUID-based lookups are not supported.
日本語の概要は準備中です。原文の説明を表示しています。
Get asset data from the asset file in the Unity project — every serializable field and property. Supports token-saving path-scoped reads via `paths` or `viewQuery`. Use 'assets-find' to find the asset first.
日本語の概要は準備中です。原文の説明を表示しています。