File tree 4 files changed +18
-2
lines changed
4 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,8 @@ public override void OnInspectorGUI()
65
65
private new void SetDirty ( )
66
66
{
67
67
EditorUtility . SetDirty ( this . target ) ;
68
+ this . Target . AllLayerInfos . HaveCache = false ;
69
+
68
70
Undo . IncrementCurrentGroup ( ) ;
69
71
}
70
72
Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ namespace a3geek.PhysicsLayers.Components
11
11
[ Serializable ]
12
12
public sealed class AllLayerInfos
13
13
{
14
+ public bool HaveCache { get ; set ; }
15
+
14
16
public PhysicsLayerInfos PhysicsLayerInfos
15
17
{
16
18
get { return this . physicsLayerInfos ; }
@@ -67,6 +69,8 @@ public AllLayerInfos()
67
69
this . UnityLayers = new Dictionary < int , string > ( ) ;
68
70
this . UnityLayerIDs = new List < int > ( ) ;
69
71
this . UnityLayerNames = new List < string > ( ) ;
72
+
73
+ this . HaveCache = false ;
70
74
}
71
75
72
76
public void UpdateCache ( )
@@ -84,6 +88,8 @@ public void UpdateCache()
84
88
{
85
89
this . ignoreLayersCache [ layerID ] = this . GetIgnoreIDs ( layerID ) ;
86
90
}
91
+
92
+ this . HaveCache = true ;
87
93
}
88
94
89
95
public IEnumerable < int > GetIgnoreLayerIDs ( int layerID )
Original file line number Diff line number Diff line change @@ -35,7 +35,15 @@ private set
35
35
36
36
public AllLayerInfos AllLayerInfos
37
37
{
38
- get { return this . allLayerInfos ; }
38
+ get
39
+ {
40
+ if ( this . allLayerInfos . HaveCache == false )
41
+ {
42
+ this . allLayerInfos . UpdateCache ( ) ;
43
+ }
44
+
45
+ return this . allLayerInfos ;
46
+ }
39
47
}
40
48
public PhysicsLayerInfos PhysicsLayerInfos
41
49
{
Original file line number Diff line number Diff line change 1
- 3.0.0
1
+ 3.0.1
You can’t perform that action at this time.
0 commit comments