Example #1
0
 private void Start()
 {
     if (UnityUserReporting.CurrentClient == null)
     {
         UnityUserReporting.Configure();
     }
 }
 private void Start()
 {
     if (Application.isPlaying)
     {
         EventSystem x = UnityEngine.Object.FindObjectOfType <EventSystem>();
         if (x == null)
         {
             GameObject gameObject = new GameObject("EventSystem");
             gameObject.AddComponent <EventSystem>();
             gameObject.AddComponent <StandaloneInputModule>();
         }
     }
     if (UnityUserReporting.CurrentClient == null)
     {
         UnityUserReporting.Configure();
     }
 }
    private void Start()
    {
        // Set Up Event System
        if (Application.isPlaying)
        {
            EventSystem sceneEventSystem = UnityEngine.Object.FindObjectOfType <EventSystem>();
            if (sceneEventSystem == null)
            {
                GameObject eventSystem = new GameObject("EventSystem");
                eventSystem.AddComponent <EventSystem>();
                eventSystem.AddComponent <StandaloneInputModule>();
            }
        }

        // Configure Client
        // This where you would want to change endpoints, override your project identifier, or provide configuration for events, metrics, and screenshots.
        UnityUserReporting.Configure();
    }
    private void Start()
    {
        mail = GameObject.Find("Logger");
        // Set Up Event System
        if (Application.isPlaying)
        {
            EventSystem sceneEventSystem = UnityEngine.Object.FindObjectOfType <EventSystem>();
            if (sceneEventSystem == null)
            {
                GameObject eventSystem = new GameObject("EventSystem");
                eventSystem.AddComponent <EventSystem>();
                eventSystem.AddComponent <StandaloneInputModule>();
            }
        }

        // Configure Client
        bool configured = false;

        if (this.UserReportingPlatform == UserReportingPlatformType.Async)
        {
            Assembly assembly = Assembly.GetExecutingAssembly();
            Type     asyncUnityUserReportingPlatformType = assembly.GetType("Unity.Cloud.UserReporting.Plugin.Version2018_3.AsyncUnityUserReportingPlatform");
            if (asyncUnityUserReportingPlatformType != null)
            {
                object activatedObject = Activator.CreateInstance(asyncUnityUserReportingPlatformType);
                IUserReportingPlatform asyncUnityUserReportingPlatform = activatedObject as IUserReportingPlatform;
                if (asyncUnityUserReportingPlatform != null)
                {
                    UnityUserReporting.Configure(asyncUnityUserReportingPlatform, this.GetConfiguration());
                    configured = true;
                }
            }
        }

        if (!configured)
        {
            UnityUserReporting.Configure(this.GetConfiguration());
        }

        // Ping
        string url = string.Format("https://userreporting.cloud.unity3d.com/api/userreporting/projects/{0}/ping", UnityUserReporting.CurrentClient.ProjectIdentifier);

        UnityUserReporting.CurrentClient.Platform.Post(url, "application/json", Encoding.UTF8.GetBytes("\"Ping\""), (upload, download) => { }, (result, bytes) => { });
    }
Example #5
0
        public void Initialize()
        {
            //IL_0077: Unknown result type (might be due to invalid IL or missing references)
            //IL_0081: Expected O, but got Unknown
            isReady = false;
            m_isCreatingUserReport   = true;
            m_isSubmittingUserReport = false;
            UnityUserReporting.Configure();
            UserReportingClient currentClient = UnityUserReporting.get_CurrentClient();

            currentClient.TakeScreenshot(1024, 1024, (Action <UserReportScreenshot>) delegate
            {
            });
            currentClient.CreateUserReport((Action <UserReport>)CreateUserReportCallback);
            m_updater = new GameObject("BugReportUpdater", new Type[1]
            {
                typeof(BugReportUpdater)
            });
        }
Example #6
0
    // Start is called before the first frame update
    void Start()
    {
        UserReportingClientConfiguration config = new UserReportingClientConfiguration(500, 300, 60, 10);

        UnityUserReporting.Configure(config);

        rightHandAnchor = GameObject.Find("RightHandAnchor");
        leftHandAnchor  = GameObject.Find("LeftHandAnchor");

        rightHandGrabber = rightHandAnchor.GetComponent <SimpleGrabber>();

        var mainDeck = GameObject.Find("MainDeck");

        deckController = mainDeck.GetComponent <DeckController>();
        deckCollider   = mainDeck.GetComponent <Collider>();

        cardHandController = leftHandAnchor.GetComponent <CardHandController>();

        Core.AsyncInitialize(appID.ToString()).OnComplete((Message <Oculus.Platform.Models.PlatformInitialize> init_message) =>
        {
            if (init_message.IsError)
            {
                Debug.LogError("Failed to initialize - " + init_message);
            }
            else
            {
                Entitlements.IsUserEntitledToApplication().OnComplete((entitlemnets_message) =>
                {
                    if (entitlemnets_message.IsError)
                    {
                        Debug.LogError("Entitlements failed - " + entitlemnets_message);
                    }
                    else
                    {
                        Users.GetLoggedInUser().OnComplete((Message <Oculus.Platform.Models.User> logged_in_user_message) =>
                        {
                            if (logged_in_user_message.IsError)
                            {
                                Debug.LogError("Could not retrieve logged in user - " + logged_in_user_message);
                            }
                            else
                            {
                                localUser = logged_in_user_message.GetUser();
                                UnityUserReporting.CurrentClient.LogEvent(UserReportEventLevel.Info, "User logged in");

                                UnityUserReporting.CurrentClient.AddDeviceMetadata("userID", localUser.ID.ToString());
                                UnityUserReporting.CurrentClient.AddDeviceMetadata("username", localUser.OculusID);

                                localAvatar = Instantiate(localAvatarPrefab);
                                localAvatar.CanOwnMicrophone = false;
                                localAvatar.UseSDKPackets    = true;
                                localAvatar.RecordPackets    = true;
                                localAvatar.PacketRecorded  += OnLocalAvatarPacketRecorded;
                                localAvatar.oculusUserID     = localUser.ID.ToString();

                                var trackingSpace = GameObject.Find("TrackingSpace");
                                localAvatar.transform.position = trackingSpace.transform.position;
                                localAvatar.transform.rotation = trackingSpace.transform.rotation;
                                localAvatar.transform.parent   = trackingSpace.transform;

                                Rooms.SetUpdateNotificationCallback(OnRoomUpdateCallback);
                                Net.SetConnectionStateChangedCallback(OnConnectionStateChangedCallback);
                                Net.SetPeerConnectRequestCallback(OnConnectRequestCallback);
                                Net.SetPingResultNotificationCallback(OnPingResultCallback);
                                Voip.SetVoipConnectRequestCallback(OnVoipConnectRequestCallback);
                                Voip.SetVoipStateChangeCallback(OnVoipStateChangedCallback);

                                // NOTE - Setting this before the platform is initialized does NOT WORK!!
                                Voip.SetMicrophoneFilterCallback(MicrophoneFilterCallback);

                                Rooms.Join(roomID, true).OnComplete(OnRoomUpdateCallback);

#if PLATFORM_ANDROID
                                if (!Permission.HasUserAuthorizedPermission(Permission.Microphone))
                                {
                                    Permission.RequestUserPermission(Permission.Microphone);
                                }

                                UnityUserReporting.CurrentClient.AddDeviceMetadata("Microphone Enabled",
                                                                                   Permission.HasUserAuthorizedPermission(Permission.Microphone).ToString());
#endif
                            }
                        });
                    }
                });
            }
        });
    }