Skip to content

Commit af705b7

Browse files
committed
Layerコンポーネントに、Managementを手動で行うための関数群を追加
1 parent 464e5ce commit af705b7

File tree

9 files changed

+33
-9
lines changed

9 files changed

+33
-9
lines changed
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Assets/PhysicsLayers/Scripts/Layers/Abstracts/AbstractLayer.cs

+32-8
Original file line numberDiff line numberDiff line change
@@ -20,36 +20,60 @@ protected LayersManager ManagerInstance
2020

2121
protected virtual void Awake()
2222
{
23-
if(this.AutoManagement == true && this.ManagerInstance != null)
23+
if(this.AutoManagement == true)
2424
{
25-
this.Management(this.ManagerInstance);
25+
this.Management();
2626
}
2727
}
2828

2929
protected virtual void OnDestroy()
3030
{
31-
if(this.AutoManagement == true && this.ManagerInstance != null)
31+
if(this.AutoManagement == true)
3232
{
33-
this.UnManagement(this.ManagerInstance);
33+
this.UnManagement();
3434
}
3535
}
3636

3737
public virtual bool ChangeLayer(int layerID)
3838
{
39-
if(this.ManagerInstance == null || this.IsEnableLayer(this.ManagerInstance, layerID) == false)
39+
if(this.IsEnableLayer(this.ManagerInstance, layerID) == false)
4040
{
4141
return false;
4242
}
4343

44-
this.ResetIgnoreCollision(this.ManagerInstance);
45-
this.UnManagement(this.ManagerInstance);
44+
this.ResetIgnoreCollision();
45+
this.UnManagement();
4646

4747
this.LayerID = layerID;
48-
this.Management(this.ManagerInstance);
48+
this.Management();
4949

5050
return true;
5151
}
5252

53+
public virtual void Management()
54+
{
55+
if(this.ManagerInstance != null)
56+
{
57+
this.Management(this.ManagerInstance);
58+
}
59+
}
60+
61+
public virtual void UnManagement()
62+
{
63+
if(this.ManagerInstance != null)
64+
{
65+
this.UnManagement(this.ManagerInstance);
66+
}
67+
}
68+
69+
public virtual void ResetIgnoreCollision()
70+
{
71+
if(this.ManagerInstance != null)
72+
{
73+
this.ResetIgnoreCollision(this.ManagerInstance);
74+
}
75+
}
76+
5377
protected abstract bool IsEnableLayer(LayersManager manager, int layerID);
5478
protected abstract void Management(LayersManager manager);
5579
protected abstract void UnManagement(LayersManager manager);

Assets/PhysicsLayers/Version.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.2.0
1+
2.3.0

ProjectSettings/DynamicsManager.asset

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)