File tree Expand file tree Collapse file tree 2 files changed +16
-16
lines changed Expand file tree Collapse file tree 2 files changed +16
-16
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,8 @@ private void OnDestroy()
50
50
51
51
#endregion
52
52
53
+ #region Public API
54
+
53
55
public bool Set ( Renderer renderer , Props props )
54
56
{
55
57
if ( renderer == null ) {
@@ -75,7 +77,15 @@ public bool Remove(Renderer renderer)
75
77
return rendererCascades . Remove ( renderer ) ;
76
78
}
77
79
78
- public bool Remove ( Props props )
80
+ public static void RegisterPropertyNamesForDebugLogging ( params string [ ] properties )
81
+ {
82
+ foreach ( var property in properties ) PropIdToName . Register ( property ) ;
83
+ }
84
+
85
+ #endregion
86
+
87
+ /// Public API equivalent is calling `Props.Dispose`.
88
+ internal bool Remove ( Props props )
79
89
{
80
90
var removed = false ;
81
91
Original file line number Diff line number Diff line change @@ -6,8 +6,7 @@ namespace Shabby.DynamicProperties;
6
6
7
7
internal static class PropIdToName
8
8
{
9
- private static readonly string [ ] CommonProperties = [
10
- "TransparentFX" ,
9
+ private static readonly string [ ] StockProperties = [
11
10
"_BumpMap" ,
12
11
"_Color" ,
13
12
"_EmissiveColor" ,
@@ -20,27 +19,18 @@ internal static class PropIdToName
20
19
"_Opacity" ,
21
20
"_RimColor" ,
22
21
"_RimFalloff" ,
23
- "_TC1Color" ,
24
- "_TC1MetalBlend" ,
25
- "_TC1Metalness" ,
26
- "_TC1SmoothBlend" ,
27
- "_TC1Smoothness" ,
28
- "_TC2Color" ,
29
- "_TC2MetalBlend" ,
30
- "_TC2Metalness" ,
31
- "_TC2SmoothBlend" ,
32
- "_TC2Smoothness" ,
33
22
"_TemperatureColor" ,
34
- "_Tex" ,
35
- "_Tint" ,
36
23
"_TintColor" ,
37
24
"_subdiv" ,
38
25
"localMatrix" ,
39
26
"upMatrix"
40
27
] ;
41
28
42
29
private static readonly Dictionary < int , string > IdToName =
43
- CommonProperties . ToDictionary ( Shader . PropertyToID , name => name ) ;
30
+ StockProperties . ToDictionary ( Shader . PropertyToID , name => name ) ;
31
+
32
+ internal static void Register ( string property ) =>
33
+ IdToName [ Shader . PropertyToID ( property ) ] = property ;
44
34
45
35
internal static string Get ( int id ) =>
46
36
IdToName . TryGetValue ( id , out var name ) ? name : $ "<{ id } >";
You can’t perform that action at this time.
0 commit comments