Esempio n. 1
0
    private FrustumMarker CreateMarker(FrustumTrackedObject obj)
    {
        var marker = Instantiate(frustumMarker, transform, false);

        markers.Add(obj, marker);
        marker.SetMarkerData(obj.data);
        return(marker);
    }
Esempio n. 2
0
    private void RemoveMarker(FrustumTrackedObject obj)
    {
        FrustumMarker marker = null;

        if (markers.TryGetValue(obj, out marker))
        {
            Destroy(marker.gameObject);
            markers.Remove(obj);
        }
    }
Esempio n. 3
0
    private void ShowMarker(FrustumTrackedObject obj)
    {
        FrustumMarker marker;

        if (markers.TryGetValue(obj, out marker) == false)
        {
            marker = CreateMarker(obj);
        }
        marker.gameObject.SetActive(true);
    }
Esempio n. 4
0
 /// <summary>
 /// Handle for tracked objects events
 /// </summary>
 /// <param name="obj"></param>
 /// <param name="isVisible"></param>
 void OnObjectVisibilityChanged(FrustumTrackedObject obj, bool isVisible)
 {
     //Debug.Log(obj.name + " is now " + (isVisible ? "visible" : "unvisible"));
     if (isVisible)
     {
         RemoveMarker(obj);
     }
     else
     {
         ShowMarker(obj);
     }
 }
 private void TestTrackedObject(FrustumTrackedObject obj)
 {
     // TODO: find a wayt to hide this public method for a tracked object
     obj.SetVisibility(outOfFrustum.TestVisisbility(obj.Bounds));
 }