|
@@ -1,9 +1,13 @@
|
|
|
|
+using Assets.StreetLight.Scripts;
|
|
|
|
+using System;
|
|
using System.Collections;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Collections.Generic;
|
|
using System.Collections.Specialized;
|
|
using System.Collections.Specialized;
|
|
|
|
+using System.Drawing;
|
|
using System.Net;
|
|
using System.Net;
|
|
using TMPro;
|
|
using TMPro;
|
|
using Unity.VisualScripting;
|
|
using Unity.VisualScripting;
|
|
|
|
+using UnityEditor.VersionControl;
|
|
using UnityEngine;
|
|
using UnityEngine;
|
|
using UnityEngine.Timeline;
|
|
using UnityEngine.Timeline;
|
|
|
|
|
|
@@ -11,6 +15,13 @@ public class CalibrationMarkerBehavior : MonoBehaviour
|
|
{
|
|
{
|
|
Vector3[] frustumCorners;
|
|
Vector3[] frustumCorners;
|
|
List<Vector3> targetPositions;
|
|
List<Vector3> targetPositions;
|
|
|
|
+ PersonManager PersonManager => personManagerLazy.Value;
|
|
|
|
+ Lazy<PersonManager> personManagerLazy;
|
|
|
|
+
|
|
|
|
+ private void Awake()
|
|
|
|
+ {
|
|
|
|
+ personManagerLazy = new Lazy<PersonManager>(FindObjectOfType<PersonManager>);
|
|
|
|
+ }
|
|
|
|
|
|
// Start is called before the first frame update
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
void Start()
|
|
@@ -28,6 +39,14 @@ public class CalibrationMarkerBehavior : MonoBehaviour
|
|
};
|
|
};
|
|
|
|
|
|
currentTarget = GameObject.Find("CalibrationMarker").transform.position;
|
|
currentTarget = GameObject.Find("CalibrationMarker").transform.position;
|
|
|
|
+
|
|
|
|
+ enabled = false;
|
|
|
|
+ PersonManager.DetectionReady += PersonManager_DetectionReady;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void PersonManager_DetectionReady(object sender, EventArgs e)
|
|
|
|
+ {
|
|
|
|
+ enabled = true;
|
|
}
|
|
}
|
|
|
|
|
|
int targetIndex = -1;
|
|
int targetIndex = -1;
|
|
@@ -51,5 +70,8 @@ public class CalibrationMarkerBehavior : MonoBehaviour
|
|
currentTarget = targetPositions[targetIndex];
|
|
currentTarget = targetPositions[targetIndex];
|
|
normalizedTranslationVector = (currentTarget - marker.transform.position).normalized;
|
|
normalizedTranslationVector = (currentTarget - marker.transform.position).normalized;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ UnityEngine.Color color = UnityEngine.Color.Lerp(UnityEngine.Color.green, UnityEngine.Color.red, Time.deltaTime / 0.2f);
|
|
|
|
+ Debug.Log(string.Format("<color=#{0:X2}{1:X2}{2:X2}>{3}</color>", (byte)(color.r * 255f), (byte)(color.g * 255f), (byte)(color.b * 255f), $"deltaTime: {Time.deltaTime}"));
|
|
}
|
|
}
|
|
}
|
|
}
|