private void OnCollisionEnter2D(Collision2D collision) { Debug.Log("COLLISION DETECTED"); if (collision.gameObject.tag == "Player") { Debug.Log("COLLIDED WITH DOOR SHOULD REMAKE"); //Clear and Rebuild from BoardGenerator. collision.gameObject.transform.position = new Vector2(2, 2); board.ClearAndRebuild(); } }
public override void OnInspectorGUI() { DrawDefaultInspector(); BoardGenerator myScript = (BoardGenerator)target; if (GUILayout.Button("Clear And Generate")) { myScript.ClearAndRebuild(); } if (GUILayout.Button("Clear")) { myScript.ClearLevel(); } }