Ejemplo n.º 1
0
    /// <summary>
    /// Sets up all required references to create and find anchors
    /// </summary>
    private void ConfigureReferences()
    {
        Log(nameof(ConfigureReferences));
        CloudManager = GetComponent <SpatialAnchorManager>();
        CloudManager.SessionUpdated         += CloudManager_SessionUpdated;
        CloudManager.AnchorLocated          += CloudManager_AnchorLocated;
        CloudManager.LocateAnchorsCompleted += CloudManager_LocateAnchorsCompleted;
        CloudManager.LogDebug += CloudManager_LogDebug;
        CloudManager.Error    += CloudManager_Error;

        CloudManager.SpatialAnchorsAccountKey    = Config.AccountKey;
        CloudManager.SpatialAnchorsAccountId     = Config.AccountId;
        CloudManager.SpatialAnchorsAccountDomain = Config.AccountDomain;
        Log($"ASA Id {Config.AccountId}", true);
        Log($"ASA Key {Config.AccountKey}", true);
        Log($"ASA Domain {Config.AccountDomain}", true);

        anchorLocateCriteria = new AnchorLocateCriteria();
        status = new AsaStatus();

        //info: DemoScript also checks a reference for an input manager here.
    }
Ejemplo n.º 2
0
    /// <summary>
    /// Sets up all required references to create and find anchors
    /// </summary>
    private void ConfigureReferences()
    {
#if !UNITY_EDITOR
        Log(nameof(ConfigureReferences), true);
        CloudManager = GetComponent <SpatialAnchorManager>();
        CloudManager.SessionUpdated         += CloudManager_SessionUpdated;
        CloudManager.AnchorLocated          += CloudManager_AnchorLocated;
        CloudManager.LocateAnchorsCompleted += CloudManager_LocateAnchorsCompleted;
        CloudManager.LogDebug += CloudManager_LogDebug;
        CloudManager.Error    += CloudManager_Error;

        CloudManager.SpatialAnchorsAccountKey    = Config.AccountKey;
        CloudManager.SpatialAnchorsAccountId     = Config.AccountId;
        CloudManager.SpatialAnchorsAccountDomain = Config.AccountDomain;
        Log($"ASA Id {Config.AccountId}", true);
        Log($"ASA Key {Config.AccountKey}", true);
        Log($"ASA Domain {Config.AccountDomain}", true);

        anchorLocateCriteria = new AnchorLocateCriteria();
#else
        Log("ASA Config skipped due to wrong platform");
#endif
        status = new AsaStatus();
    }
Ejemplo n.º 3
0
 public AsaStatusEventArgs(AsaStatusEventType type, AsaStatus status)
 {
     Type   = type;
     Status = status;
 }
Ejemplo n.º 4
0
 private void SendUpdateOnMainThread(AsaStatusEventType type, AsaStatus status)
 {
     ExecuteOnMainThread(new Action(() => AsaStatusEventHook?.Invoke(this, new AsaStatusEventArgs(type, status))));
 }
Ejemplo n.º 5
0
 private void SendUpdateOnMainThread(AsaStatusEventType type, AsaStatus status)
 {
     Log($"{type}, {status.Percentage}", false);
     ExecuteOnMainThread(new Action(() => AsaStatusEventHook?.Invoke(this, new AsaStatusEventArgs(type, status))));
 }