-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added AddMetadataOfType extension (editor only)
- Loading branch information
1 parent
6015dbd
commit 5540896
Showing
5 changed files
with
55 additions
and
17 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using System.Runtime.CompilerServices; | ||
using UnityEngine; | ||
|
||
public static class AddMetadataOfTypeExtensions | ||
{ | ||
[MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
public static Metadata AddMetadataOfType<Metadata>(this Material asset) | ||
where Metadata : CustomAssetMetadata | ||
{ | ||
return AssetMetadataUtility.Add<Metadata>(asset) as Metadata; | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Editor/AssetExtensions/AddMetadataOfTypeExtensions.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters