Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public bool CustomToggle(bool myToggle, int height, int width) {
- string boxChecked;
- if (myToggle) {
- boxChecked = "X";
- } else {
- boxChecked = "";
- }
- if (GUILayout.Button(boxChecked, GUILayout.Height(height),
- GUILayout.Width(width))) {
- myToggle = !myToggle;
- }
- return myToggle;
- }
- public override void OnInspectorGUI()
- {
- EditorGUIUtility.LookLikeInspector();
- EditorGUILayout.BeginVertical();
- for (int y = 0; y < Target.MaskHeight; y++)
- {
- EditorGUILayout.BeginHorizontal();
- for (int x = 0; x < Target.MaskWidth; x++)
- {
- Target.Mask[x,y] = CustomToggle(Target.Mask[x, y], 16, 16);
- }
- EditorGUILayout.EndHorizontal();
- }
- EditorGUILayout.EndVertical();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement