Skip to content

Commit 88bcf4f

Browse files
committed
PhysicsLayerAttributeが動作しない問題を修正、Editor上からでもPropertyにアクセスしたら値が取得できるように変更。
1 parent 2a3bbbd commit 88bcf4f

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

Assets/PhysicsLayers/Editor/LayersManagerInspector.cs

+2
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ public override void OnInspectorGUI()
6565
private new void SetDirty()
6666
{
6767
EditorUtility.SetDirty(this.target);
68+
this.Target.AllLayerInfos.HaveCache = false;
69+
6870
Undo.IncrementCurrentGroup();
6971
}
7072

Assets/PhysicsLayers/Scripts/Components/AllLayerInfos.cs

+6
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ namespace a3geek.PhysicsLayers.Components
1111
[Serializable]
1212
public sealed class AllLayerInfos
1313
{
14+
public bool HaveCache { get; set; }
15+
1416
public PhysicsLayerInfos PhysicsLayerInfos
1517
{
1618
get { return this.physicsLayerInfos; }
@@ -67,6 +69,8 @@ public AllLayerInfos()
6769
this.UnityLayers = new Dictionary<int, string>();
6870
this.UnityLayerIDs = new List<int>();
6971
this.UnityLayerNames = new List<string>();
72+
73+
this.HaveCache = false;
7074
}
7175

7276
public void UpdateCache()
@@ -84,6 +88,8 @@ public void UpdateCache()
8488
{
8589
this.ignoreLayersCache[layerID] = this.GetIgnoreIDs(layerID);
8690
}
91+
92+
this.HaveCache = true;
8793
}
8894

8995
public IEnumerable<int> GetIgnoreLayerIDs(int layerID)

Assets/PhysicsLayers/Scripts/LayersManager.cs

+9-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,15 @@ private set
3535

3636
public AllLayerInfos AllLayerInfos
3737
{
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+
}
3947
}
4048
public PhysicsLayerInfos PhysicsLayerInfos
4149
{

Assets/PhysicsLayers/Version.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.0.0
1+
3.0.1

0 commit comments

Comments
 (0)