Skip to content

Commit 73564ae

Browse files
Ryan KimRyan Kim
authored andcommitted
Changed ReadOnly attribute to ReadOnlyInsp attribute, to help prevent overlap with Unity Job's ReadOnly attribute
1 parent 50ecb5d commit 73564ae

File tree

5 files changed

+21
-20
lines changed

5 files changed

+21
-20
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
**/*.meta
1+
**/*.meta
2+
**/.DS_Store

CSVWriter/CSVWriter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class CSVWriter
1717
public bool append_zero_to_filename = false;
1818
public List<string> columns;
1919

20-
[SerializeField, ReadOnly] private string filePath;
20+
[SerializeField, ReadOnlyInsp] private string filePath;
2121
private StreamWriter eventWriter;
2222
private List<string> payload = new List<string>();
2323
private bool _is_active = false;

CSVWriter/JSONWriter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class JSONWriter
1515
public string dirName = null;
1616
public bool append_zero_to_filename = false;
1717

18-
[SerializeField, ReadOnly] private string filePath;
18+
[SerializeField, ReadOnlyInsp] private string filePath;
1919
private StreamWriter eventWriter;
2020
private List<string> payload = new List<string>();
2121
private bool is_active = false;

ReadOnly/Editor/ReadOnlyDrawer.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
using UnityEditor;
22
using UnityEngine;
33

4-
[CustomPropertyDrawer( typeof( ReadOnlyAttribute ) )]
5-
public class ReadOnlyDrawer : PropertyDrawer {
4+
[CustomPropertyDrawer( typeof( ReadOnlyInspAttribute ) )]
5+
public class ReadOnlyInspDrawer : PropertyDrawer {
66

77
public override float GetPropertyHeight( SerializedProperty property, GUIContent label ) {
88
return EditorGUI.GetPropertyHeight( property, label, true );
@@ -16,8 +16,8 @@ public override void OnGUI( Rect position, SerializedProperty property, GUIConte
1616

1717
}
1818

19-
[CustomPropertyDrawer( typeof( BeginReadOnlyGroupAttribute ) )]
20-
public class BeginReadOnlyGroupDrawer : DecoratorDrawer {
19+
[CustomPropertyDrawer( typeof( BeginReadOnlyInspGroupAttribute ) )]
20+
public class BeginReadOnlyInspGroupDrawer : DecoratorDrawer {
2121

2222
public override float GetHeight() { return 0; }
2323

@@ -27,8 +27,8 @@ public override void OnGUI( Rect position ) {
2727

2828
}
2929

30-
[CustomPropertyDrawer( typeof( EndReadOnlyGroupAttribute ) )]
31-
public class EndReadOnlyGroupDrawer : DecoratorDrawer {
30+
[CustomPropertyDrawer( typeof( EndReadOnlyInspGroupAttribute ) )]
31+
public class EndReadOnlyInspGroupDrawer : DecoratorDrawer {
3232

3333
public override float GetHeight() { return 0; }
3434

ReadOnly/ReadOnlyAttribute.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@
44
/// Display a field as read-only in the inspector.
55
/// CustomPropertyDrawers will not work when this attribute is used.
66
/// </summary>
7-
/// <seealso cref="BeginReadOnlyGroupAttribute"/>
8-
/// <seealso cref="EndReadOnlyGroupAttribute"/>
9-
public class ReadOnlyAttribute : PropertyAttribute { }
7+
/// <seealso cref="BeginReadOnlyInspGroupAttribute"/>
8+
/// <seealso cref="EndReadOnlyInspGroupAttribute"/>
9+
public class ReadOnlyInspAttribute : PropertyAttribute { }
1010

1111
/// <summary>
1212
/// Display one or more fields as read-only in the inspector.
13-
/// Use <see cref="EndReadOnlyGroupAttribute"/> to close the group.
13+
/// Use <see cref="EndReadOnlyInspGroupAttribute"/> to close the group.
1414
/// Works with CustomPropertyDrawers.
1515
/// </summary>
16-
/// <seealso cref="EndReadOnlyGroupAttribute"/>
17-
/// <seealso cref="ReadOnlyAttribute"/>
18-
public class BeginReadOnlyGroupAttribute : PropertyAttribute { }
16+
/// <seealso cref="EndReadOnlyInspGroupAttribute"/>
17+
/// <seealso cref="ReadOnlyInspAttribute"/>
18+
public class BeginReadOnlyInspGroupAttribute : PropertyAttribute { }
1919

2020
/// <summary>
21-
/// Use with <see cref="BeginReadOnlyGroupAttribute"/>.
21+
/// Use with <see cref="BeginReadOnlyInspGroupAttribute"/>.
2222
/// Close the read-only group and resume editable fields.
2323
/// </summary>
24-
/// <seealso cref="BeginReadOnlyGroupAttribute"/>
25-
/// <seealso cref="ReadOnlyAttribute"/>
26-
public class EndReadOnlyGroupAttribute : PropertyAttribute { }
24+
/// <seealso cref="BeginReadOnlyInspGroupAttribute"/>
25+
/// <seealso cref="ReadOnlyInspAttribute"/>
26+
public class EndReadOnlyInspGroupAttribute : PropertyAttribute { }

0 commit comments

Comments
 (0)