Code improvement

This commit is contained in:
Pascal Serrarens 2022-06-03 17:28:19 +02:00
parent 219f2f987c
commit 59f4add2ac
5 changed files with 14 additions and 4 deletions

View File

@ -1082,7 +1082,7 @@ namespace Passer {
using (new EditorGUILayout.HorizontalScope()) {
EditorGUILayout.LabelField("Tracker", GUILayout.Width(120));
if (TrackerComponentShowButton())
tracker.CheckTracker(humanoid);
tracker.GetTrackerComponent();
}
}
else {

View File

@ -16,7 +16,7 @@ namespace Passer.Humanoid {
public SensorComponent sensorComponent;
/// <summary>
/// Returns sensorComponent and creates a new sensorComponent if it does not exist
/// Returns sensorComponent and creates a new SensorComponent if it does not exist
/// </summary>
/// <returns></returns>
public abstract SensorComponent GetSensorComponent();

View File

@ -8,7 +8,7 @@ namespace Passer.Humanoid {
/// <summary>
/// A %Humanoid tracker
/// </summary>
public class HumanoidTracker : Tracker {
public abstract class HumanoidTracker : Tracker {
/// <summary>
/// The humanoid for this tracker
/// </summary>

View File

@ -7,7 +7,7 @@ namespace Passer {
/// <summary>
/// A tracker
/// </summary>
public class Tracker {
public abstract class Tracker {
/// <summary>
/// The tracking status
/// </summary>
@ -36,6 +36,11 @@ namespace Passer {
/// The tracking device
/// </summary>
public TrackerComponent trackerComponent;
/// <summary>
/// Returns trackerComponent and creates a new TrackerComponent if it does not exist
/// </summary>
/// <returns></returns>
public abstract TrackerComponent GetTrackerComponent();
#region SubTrackers

View File

@ -129,6 +129,11 @@ namespace Passer.Humanoid {
#region Manage
public override TrackerComponent GetTrackerComponent() {
CheckTracker(humanoid, UnityXR.Get);
return trackerComponent;
}
public override void CheckTracker(HumanoidControl humanoid) {
CheckTracker(humanoid, UnityXR.Get);
}