You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Doing a second inspector UI pass to include tool tips and rename each element item to the component's standard inspector view naming where it is the GameObject's name followed by the class name that is separated by capitalization and contained within parenthesis.
// Ignoring the naming convention in order to auto-assign element names
23
+
#pragma warning disable IDE1006
24
+
publicstringname="Component";
25
+
#pragma warning restore IDE1006
26
+
16
27
/// <summary>
17
28
/// When true, this component's enabled state will be the inverse of
18
29
/// the value passed into <see cref="ComponentController.SetEnabled(bool)"/>.
19
30
/// </summary>
20
-
[Tooltip("When enabled, this component will inversely mirror the currently applied enable or disable state.")]
31
+
[Tooltip("When enabled, this component will inversely mirror the currently applied ComponentController's enabled state.")]
21
32
publicboolInvertEnabled;
22
33
23
34
/// <summary>
24
35
/// The amount of time to delay enabling this component when the <see cref="ComponentController"/> has just transitioned from a disabled to enabled state.
25
36
/// </summary>
37
+
/// <remarks>
38
+
/// This can be useful under scenarios where you might want to prevent a component from being enabled too early prior to making any adjustments.<br />
39
+
/// As an example, you might find that delaying the enabling of a <see cref="MeshRenderer"/> until at least the next frame will avoid any single frame
40
+
/// rendering anomalies until the <see cref="Rigidbody"/> has updated the <see cref="Transform"/>.
41
+
/// </remarks>
26
42
[Range(0.0f,2.0f)]
43
+
[Tooltip("The amount of time to delay when transitioning this component from disabled to enabled. When 0, the change is immediate.")]
27
44
publicfloatEnableDelay;
28
45
29
46
/// <summary>
30
47
/// The amount of time to delay disabling this component when the <see cref="ComponentController"/> has just transitioned from an enabled to disabled state.
31
48
/// </summary>
49
+
/// <remarks>
50
+
/// This can be useful under scenarios where you might want to prevent a component from being disabled too early prior to making any adjustments.<br />
51
+
/// </remarks>
52
+
[Tooltip("The amount of time to delay when transitioning this component from enabled to disabled. When 0, the change is immediate.")]
32
53
[Range(0f,2.0f)]
33
54
publicfloatDisableDelay;
34
55
35
56
/// <summary>
36
-
/// The component to control.
57
+
/// The component that will have its enabled property synchronized.
37
58
/// </summary>
38
59
/// <remarks>
39
-
/// You can assign an entire <see cref="GameObject"/> to this property which will
40
-
/// add all components attached to the <see cref="GameObject"/>. The <see cref="StartEnabled"/>
41
-
/// and <see cref="InvertEnabled"/> properties will be applied to all components found on the <see cref="GameObject"/>.
60
+
/// You can assign an entire <see cref="GameObject"/> to this property which will add all components attached to the <see cref="GameObject"/> and its children.
42
61
/// </remarks>
62
+
[Tooltip("The component that will have its enabled status synchonized. You can drop a GameObject onto this field and all valid components will be added to the list.")]
43
63
publicObjectComponent;
44
64
internalPropertyInfoPropertyInfo;
45
65
@@ -141,17 +161,16 @@ internal PendingStateUpdate(ComponentControllerEntry componentControllerEntry, b
141
161
}
142
162
143
163
/// <summary>
144
-
/// Handles enabling or disabling commonly used components, behaviours, RenderMeshes, etc.<br />
145
-
/// Anything that derives from <see cref="Component"/> and has an enabled property can be added
146
-
/// to the list of objects.<br />
147
-
/// <see cref="NetworkBehaviour"/> derived components are not allowed and will be automatically removed.
164
+
/// Handles enabling or disabling commonly used components like <see cref="MonoBehaviour"/>, <see cref="MeshRenderer"/>, <see cref="Collider"/>, etc.<br />
165
+
/// Anything that derives from <see cref="Component"/> and has an enabled property can be added to the list of objects.<br />
166
+
/// NOTE: <see cref="NetworkBehaviour"/> derived components are not allowed and will be automatically removed.
148
167
/// </summary>
149
168
/// <remarks>
150
-
/// This will synchronize the enabled or disabled state of the <see cref="Component"/>s with
151
-
/// connected and late joining clients.<br />
152
-
/// This class provides the basic functionality to synchronizing components' enabled state.<br />
153
-
/// It is encouraged to create custom derived versions of this class to provide any additional
154
-
/// functionality required for your project specific needs.
169
+
/// This will synchronize the enabled or disabled state of the <see cref="Component"/>s with connected and late joining clients.<br />
170
+
/// - Use <see cref="EnabledState"/> to determine the current synchronized enabled state. <br />
171
+
/// - Use <see cref="SetEnabled(bool)"/> to change the enabled state and have the change applied to all components this <see cref="ComponentController"/> is synchronizing.<br />
172
+
///
173
+
/// It is encouraged to create custom derived versions of this class to provide any additional functionality required for your project specific needs.
155
174
/// </remarks>
156
175
publicclassComponentController:NetworkBehaviour
157
176
{
@@ -176,6 +195,21 @@ public class ComponentController : NetworkBehaviour
Debug.LogWarning($"Removing {Components[i].Component.name} since {nameof(NetworkBehaviour)}s are not allowed to be controlled by this component.");
247
+
Debug.LogWarning($"Removing {GetComponentNameFormatted(Components[i].Component)} since {Components[i].Component.GetType().Name} is not an allowed component type.");
0 commit comments