浏览代码

fixed missing reference for standalone players

/0.9.0.preview.1_staging
Aryan Mann 3 年前
当前提交
2427951b
共有 2 个文件被更改,包括 20 次插入12 次删除
  1. 30
      com.unity.perception/Runtime/PerceptionAnalytics.cs
  2. 2
      com.unity.perception/Runtime/PerceptionAnalyticsStructs.cs

30
com.unity.perception/Runtime/PerceptionAnalytics.cs


using Unity.Simulation;
using UnityEngine.Analytics;
using UnityEngine;
using UnityEngine.Assertions;
using UnityEngine.Perception.GroundTruth;
using UnityEngine.Perception.Randomization.Randomizers;
#if UNITY_EDITOR

public string name { get; private set; }
public AnalyticsEventType type { get; private set; }
public int versionId { get; private set; }
public string prefix { get; private set; }
public AnalyticsEvent(string name, AnalyticsEventType type, int versionId)
public AnalyticsEvent(string name, AnalyticsEventType type, int versionId, string prefix = "")
this.prefix = prefix;
// Make sure prefix is defined if the event is a runtime event
if (this.type == AnalyticsEventType.RuntimeAndEditor || this.type == AnalyticsEventType.Runtime)
{
Assert.IsTrue(!string.IsNullOrWhiteSpace(this.prefix));
}
}
}

#region Event Definition
static readonly AnalyticsEvent k_EventScenarioInformation = new AnalyticsEvent(
"perceptionScenarioInformation", AnalyticsEventType.RuntimeAndEditor, 1
"perceptionScenarioInformation", AnalyticsEventType.RuntimeAndEditor, 1,
"ai.cv"
);
static readonly AnalyticsEvent k_EventRunInUnitySimulation = new AnalyticsEvent(
"runinunitysimulation", AnalyticsEventType.Editor, 1

#if UNITY_EDITOR
var status = EditorAnalytics.RegisterEventWithLimit(theEvent.name, k_MaxEventsPerHour, k_MaxElementsInStruct, k_VendorKey);
#else
var status = Analytics.Analytics.RegisterEvent(theEvent.name, k_MaxEventsPerHour, k_MaxElementsInStruct, k_VendorKey);
var status = UnityEngine.Analytics.Analytics.RegisterEvent(theEvent.name, k_MaxEventsPerHour, k_MaxElementsInStruct, k_VendorKey);
Debug.Log($"Registering event {theEvent.name}. Operation {(s_EventRegistrationStatus[theEvent] ? "" : "un")}successful.");
// Debug.Log($"Registering event {theEvent.name}. Operation {(s_EventRegistrationStatus[theEvent] ? "" : "un")}successful.");
return s_EventRegistrationStatus[theEvent];
}

/// </summary>
/// <param name="theEvent">The analytics event.</param>
/// <param name="data">Payload of the event.</param>
/// <param name="prefix">If Runtime event, what is the prefix ("domain.schema")?</param>
static void SendEvent(AnalyticsEvent theEvent, object data, string prefix = "")
static void SendEvent(AnalyticsEvent theEvent, object data)
Debug.Log($"Reporting {theEvent.name}.");
// Debug.Log($"Reporting {theEvent.name}.");
#endif
#else
UnityEngine.Analytics.Analytics.SendEvent(theEvent.name, data, theEvent.versionId, prefix);
UnityEngine.Analytics.Analytics.SendEvent(theEvent.name, data, theEvent.versionId, theEvent.prefix);
#endif
}
#endregion

"BoundingBox3DLabeler", "BoundingBox2DLabeler", "InstanceSegmentationLabeler",
"KeypointLabeler", "ObjectCountLabeler", "SemanticSegmentationLabeler", "RenderedObjectInfoLabeler"
};
internal static void ReportScenarioCompleted(
PerceptionCamera cam,

2
com.unity.perception/Runtime/PerceptionAnalyticsStructs.cs


var randomizerType = randomizer.GetType();
// Only looks for randomizers included by the Perception package.
// Filter out randomizers which could be considered personally identifiable.
if (randomizerType.Namespace == null || !randomizerType.Namespace.StartsWith("UnityEngine.Perception"))
return null;

正在加载...
取消
保存