File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change 55public abstract class CustomAssetMetadata : ScriptableObject
66{
77 // Keep a reference to our original asset so we can hook them up the moment we find the asset
8- [ HideInInspector , SerializeField ] internal LazyLoadReference < UnityEngine . Object > reference ;
8+ [ HideInInspector , SerializeField ] internal LazyLoadReference < UnityEngine . Object > reference ;
99
10- // These methods are to handle creating and destroying metadata in the editor and not leave the asset dangling
11- [ Conditional ( "UNITY_EDITOR" ) ] private void OnEnable ( ) { if ( Application . isEditor && reference . isSet && ! reference . isBroken ) MetadataLookup . Register ( reference , this ) ; }
10+ // These methods are to handle creating and destroying metadata in the editor and not leave the asset dangling
11+ [ Conditional ( "UNITY_EDITOR" ) ] private void OnEnable ( ) { if ( Application . isEditor && reference . isSet && ! reference . isBroken ) MetadataLookup . Register ( reference , this ) ; }
1212 [ Conditional ( "UNITY_EDITOR" ) ] private void OnDisable ( ) { if ( Application . isEditor && reference . isSet && ! reference . isBroken ) MetadataLookup . Unregister ( reference , this ) ; }
1313
14- public virtual void OnReset ( ) { }
14+ public UnityEngine . Object AssociatedAsset
15+ {
16+ get
17+ {
18+ if ( ! reference . isSet || reference . isBroken )
19+ return null ;
20+ return reference . asset ;
21+ }
22+ }
23+
24+ public virtual void OnReset ( ) { }
1525}
Original file line number Diff line number Diff line change 11{
22 "name" : " com.custom_asset_metadata" ,
33 "displayName" : " Custom Asset Metadata" ,
4- "version" : " 1.2.0 " ,
4+ "version" : " 1.2.1 " ,
55 "unity" : " 2020.3" ,
66 "description" : " Adds the ability to store meta data on Assets" ,
77 "license" : " MIT" ,
You can’t perform that action at this time.
0 commit comments