Commit 41bb5f5d authored by Tommé Nöll's avatar Tommé Nöll
Browse files

fixed door starting open

parent ebd5de26
......@@ -14,7 +14,7 @@ GameObject:
- component: {fileID: 857212579820544967}
- component: {fileID: 2105881298012768113}
m_Layer: 0
m_Name: RemovableWall
m_Name: Door
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
......
......@@ -108,7 +108,7 @@ BoxCollider2D:
adaptiveTiling: 0
m_AutoTiling: 0
serializedVersion: 2
m_Size: {x: 0.64, y: 0.64}
m_Size: {x: 2.19, y: 2.64}
m_EdgeRadius: 0
--- !u!114 &299633547317264585
MonoBehaviour:
......
......@@ -11,14 +11,20 @@ public class SwitchTarget : MonoBehaviour {
private Animator anim;
private Collider2D collider;
private bool init = false;
void Start() {
if (toggleAnimationState) anim = GetComponent<Animator>();
if (toggleCollider) collider = GetComponent<Collider2D>();
init = true;
}
public void Switch(bool on)
{
if (!init)
{
Start();
}
if (invert)
{
on = !on;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment