コード例 #1
0
ファイル: DoorController.cs プロジェクト: jk0524/gameDev
 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();
     }
 }
コード例 #2
0
        public override void OnInspectorGUI()
        {
            DrawDefaultInspector();

            BoardGenerator myScript = (BoardGenerator)target;

            if (GUILayout.Button("Clear And Generate"))
            {
                myScript.ClearAndRebuild();
            }

            if (GUILayout.Button("Clear"))
            {
                myScript.ClearLevel();
            }
        }