Skip to content

Commit 982e7bb

Browse files
committed
Update XML documentations
1 parent 0d776cd commit 982e7bb

15 files changed

+127
-23
lines changed

Assets/LandmarksR/Scripts/Animation/LightColorAnimate.cs

+14-5
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,36 @@
22

33
namespace LandmarksR.Scripts.Animation
44
{
5+
/// <summary>
6+
/// Animates the color of a light component through a rainbow spectrum.
7+
/// </summary>
58
public class LightColorAnimate : MonoBehaviour
69
{
10+
/// <summary>
11+
/// The speed of the color change animation.
12+
/// </summary>
713
public float speed = 2f;
8-
public Color color = Color.white;
14+
915
private Light _light;
1016
private float _time;
1117

18+
/// <summary>
19+
/// Initializes the light component.
20+
/// </summary>
1221
private void Start()
1322
{
1423
_light = GetComponent<Light>();
1524
}
1625

26+
/// <summary>
27+
/// Updates the light color each frame.
28+
/// </summary>
1729
private void Update()
1830
{
1931
_time += Time.deltaTime * speed * 0.05f;
2032

21-
// rainbow color
33+
// Update the light color to a rainbow color.
2234
_light.color = Color.HSVToRGB(Mathf.PingPong(_time, 1), 1, 1);
23-
24-
// _light.color = Color.Lerp(Color.white, color, Mathf.PingPong(_time, 1));
25-
2635
}
2736
}
2837
}

Assets/LandmarksR/Scripts/Animation/RotateAnimate.cs

+13
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,24 @@
22

33
namespace LandmarksR.Scripts.Animation
44
{
5+
/// <summary>
6+
/// Rotates the GameObject around a specified axis at a specified speed.
7+
/// </summary>
58
public class RotateAnimate : MonoBehaviour
69
{
10+
/// <summary>
11+
/// The speed of the rotation.
12+
/// </summary>
713
public float speed = 2f;
14+
15+
/// <summary>
16+
/// The axis around which the GameObject will rotate.
17+
/// </summary>
818
public Vector3 axis = Vector3.forward;
919

20+
/// <summary>
21+
/// Updates the rotation of the GameObject each frame.
22+
/// </summary>
1023
private void Update()
1124
{
1225
// Rotate the object around its local axis

Assets/LandmarksR/Scripts/Attributes/NotEditableAttribute.cs

+22-1
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,36 @@
44
namespace LandmarksR.Scripts.Attributes
55
{
66
#if UNITY_EDITOR
7+
/// <summary>
8+
/// Attribute to make a property not editable in the Unity Inspector.
9+
/// </summary>
710
public class NotEditableAttribute : PropertyAttribute
811
{
912
}
1013

14+
/// <summary>
15+
/// Custom property drawer for the NotEditableAttribute.
16+
/// </summary>
1117
[CustomPropertyDrawer(typeof(NotEditableAttribute))]
1218
public sealed class NotEditableDrawer : PropertyDrawer
1319
{
20+
/// <summary>
21+
/// Gets the height of the property.
22+
/// </summary>
23+
/// <param name="property">The serialized property.</param>
24+
/// <param name="label">The label of the property.</param>
25+
/// <returns>The height of the property.</returns>
1426
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
1527
{
1628
return EditorGUI.GetPropertyHeight(property, label, true);
1729
}
1830

31+
/// <summary>
32+
/// Renders the property in the Unity Inspector.
33+
/// </summary>
34+
/// <param name="position">The position to render the property.</param>
35+
/// <param name="property">The serialized property.</param>
36+
/// <param name="label">The label of the property.</param>
1937
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
2038
{
2139
EditorGUI.BeginDisabledGroup(true);
@@ -24,7 +42,10 @@ public override void OnGUI(Rect position, SerializedProperty property, GUIConten
2442
}
2543
}
2644
#else
27-
public class NotEditableAttribute: System.Attribute
45+
/// <summary>
46+
/// Attribute to make a property not editable.
47+
/// </summary>
48+
public class NotEditableAttribute : System.Attribute
2849
{
2950
}
3051
#endif

Assets/LandmarksR/Scripts/Editor/CreateMenuItem.cs

+8
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ namespace LandmarksR.Scripts.Editor
66
{
77
public static class CreateMenuItem
88
{
9+
/// <summary>
10+
/// Creates a new GameObject with a specified component attached to it.
11+
/// This is a help method to create a GameObject with a component attached to it.
12+
/// Check Assets/LandmarksR/Scripts/Tasks/Editor/hierarchyMenu.cs for example usage.
13+
/// </summary>
14+
/// <param name="menuCommand"></param>
15+
/// <param name="name"></param>
16+
/// <typeparam name="T"></typeparam>
917
public static void CreateGameObjectContextMenu<T>(MenuCommand menuCommand, string name) where T: Component
1018
{
1119
var go = new GameObject(name);

Assets/LandmarksR/Scripts/Editor/DataUtility.cs

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ namespace LandmarksR.Scripts.Editor
77
{
88
public class DataUtility: EditorWindow
99
{
10+
/// <summary>
11+
/// Opens the data folder in the file explorer.
12+
/// </summary>
1013
[MenuItem("LandmarksR/Open Data Folder")]
1114
private static void OpenDataFolder()
1215
{

Assets/LandmarksR/Scripts/Editor/ExpandInspector.cs

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ namespace LandmarksR.Scripts.Editor
55
{
66
public class ExpandInspector: EditorWindow
77
{
8+
/// <summary>
9+
/// Expands the selected GameObject in the Hierarchy window.
10+
/// </summary>
811
[MenuItem("EditorUtility/Shortcuts/Expand Selected Tasks &q")]
912
//https://stackoverflow.com/a/66366775
1013
private static void ExpandTasks()

Assets/LandmarksR/Scripts/Editor/SetUid.cs

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77

88
namespace LandmarksR.Scripts.Editor
99
{
10+
/// <summary>
11+
/// Assigns a unique identifier to all tasks in the scene.
12+
/// Currently, not in use.
13+
/// </summary>
1014
public class SetUid : EditorWindow
1115
{
1216

Assets/LandmarksR/Scripts/Experiment/Data/Editor/DelimiterOptionDrawer.cs

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
namespace LandmarksR.Scripts.Experiment.Data.Editor
66
{
7+
/// <summary>
8+
/// Custom property drawer for the DelimiterOption class.
9+
/// </summary>
710
[CustomPropertyDrawer(typeof(DelimiterOption))]
811
public class DelimiterOptionDrawer : PropertyDrawer
912
{

Assets/LandmarksR/Scripts/Experiment/Data/Editor/TextTableEditor.cs

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77

88
namespace LandmarksR.Scripts.Experiment.Data.Editor
99
{
10+
/// <summary>
11+
/// Custom Unity Inspector for the TextTable class.
12+
/// </summary>
1013
[CustomEditor(typeof(TextTable))]
1114
public class TextTableEditor : UnityEditor.Editor
1215
{

Docfx/docs/.obsidian/workspace.json

+46-13
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,44 @@
2525
"state": {
2626
"type": "image",
2727
"state": {
28-
"file": "images/RepeatTask.png"
28+
"file": "images/create_root_task.png"
29+
}
30+
}
31+
},
32+
{
33+
"id": "63aa1592bcbbaf9a",
34+
"type": "leaf",
35+
"state": {
36+
"type": "image",
37+
"state": {
38+
"file": "images/calibration_prefabs.png"
39+
}
40+
}
41+
},
42+
{
43+
"id": "560b3d41b28230f4",
44+
"type": "leaf",
45+
"state": {
46+
"type": "image",
47+
"state": {
48+
"file": "images/calibration_prefabs.png"
49+
}
50+
}
51+
},
52+
{
53+
"id": "293fd5a5cc0ac185",
54+
"type": "leaf",
55+
"state": {
56+
"type": "markdown",
57+
"state": {
58+
"file": "landmarks_r_structure.md",
59+
"mode": "source",
60+
"source": true
2961
}
3062
}
3163
}
3264
],
33-
"currentTab": 1
65+
"currentTab": 4
3466
}
3567
],
3668
"direction": "vertical"
@@ -96,7 +128,7 @@
96128
"state": {
97129
"type": "backlink",
98130
"state": {
99-
"file": "images/RepeatTask.png",
131+
"file": "landmarks_r_structure.md",
100132
"collapseAll": false,
101133
"extraContext": false,
102134
"sortOrder": "alphabetical",
@@ -113,7 +145,7 @@
113145
"state": {
114146
"type": "outgoing-link",
115147
"state": {
116-
"file": "images/RepeatTask.png",
148+
"file": "landmarks_r_structure.md",
117149
"linksCollapsed": false,
118150
"unlinkedCollapsed": true
119151
}
@@ -136,7 +168,7 @@
136168
"state": {
137169
"type": "outline",
138170
"state": {
139-
"file": "images/RepeatTask.png"
171+
"file": "landmarks_r_structure.md"
140172
}
141173
}
142174
}
@@ -157,18 +189,19 @@
157189
"command-palette:Open command palette": false
158190
}
159191
},
160-
"active": "99a8680c970a034c",
192+
"active": "293fd5a5cc0ac185",
161193
"lastOpenFiles": [
194+
"introduction.md",
195+
"data.md",
196+
"core_components.md",
197+
"landmarks_r_structure.md",
198+
"images/calibration_prefabs.png",
199+
"images/create_landmarks_r.png",
200+
"images/create_root_task.png",
201+
"images/RepeatTask.png",
162202
"Unit Testing.md",
163203
"Quest Calibration.md",
164204
"Quick Introduction to Quest.md",
165-
"landmarks_r_structure.md",
166-
"introduction.md",
167-
"core_components.md",
168-
"calibration_prefabs.png",
169-
"create_root_task.png",
170-
"create_landmarks_r.png",
171-
"data.md",
172205
"images/framework_unity_structure.png",
173206
"tasks.md",
174207
"2. Core Components.md"

Docfx/docs/core_components.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ All these components are initialized before any tasks. You will frequently refer
5454
### Step 1: Create a `GameObject` Called "LandmarksR"
5555
- Create a new GameObject and name it "LandmarksR".
5656
- Click on `Add Component` and add the `Experiment` script.
57-
![Create LandmarksR](create_landmarks_r.png)
57+
58+
![Create LandmarksR](images/create_landmarks_r.png)
5859

5960
### Step 2: Add `PlayerController`
6061
- In the Project Explorer, navigate to `Assets/LandmarksR/Prefabs/Core`.
@@ -69,7 +70,8 @@ All these components are initialized before any tasks. You will frequently refer
6970
- Create an empty root task by right-clicking on the "LandmarksR" GameObject.
7071
- Navigate to `Experiment/Tasks/1.RootTask` and click on `RootTask` to create it.
7172
- Remember to change the tag of this GameObject to `RootTask`.
72-
![Create RootTask](create_root_task.png)
73+
74+
![Create RootTask](images/create_root_task.png)
7375

7476
### Step 5 (Optional): Create Settings and Experiment Logger
7577
- Create a new GameObject called "Settings" and add the `Settings` script to it. Refer to the settings page for more configuration information.
@@ -82,4 +84,5 @@ All these components are initialized before any tasks. You will frequently refer
8284
### Step Ex.2: Add Calibration Space and Calibration Task (VR)
8385
- Drag and drop the `CalibrationTask` under `RootTask`, ensuring it is the **first** task.
8486
- Drag and drop the `Calibration Space` into the "LandmarksR" GameObject (not under the "Environment").
85-
![Calibration Prefabs](calibration_prefabs.png)
87+
88+
![Calibration Prefabs](images/calibration_prefabs.png)

Docfx/docs/landmarks_r_structure.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
Let's first break down the framework structure inside the Unity Editor
33

44
# Overall Structure
5-
Here's a screenshot of that
5+
Here's a screenshot of an project
6+
67
![](images/framework_unity_structure.png)
78

89
| GameObject | Required By LandmarksR | Purpose | Assigned/Required Tag |

0 commit comments

Comments
 (0)