public override void OnInspectorGUI() { DrawDefaultInspector(); pprefab = (GameObject)EditorGUILayout.ObjectField(pprefab, typeof(GameObject), true); val = EditorGUILayout.IntField("Card Value:", val); cname = EditorGUILayout.TextField("Card Name:", cname); suit = EditorGUILayout.TextField("Card Suit:", suit); if (GUILayout.Button("Generate Card")) { CardGenerator.CreateCardSciptObject(false, suit, cname, val, 0, pprefab); } }