ErrorCode SetDefaultAnnotation(MessageUtil.LoadingState state)
        {
            var annotation = new TAnnotation();

            MessageUtil.SetScene(annotation, SceneManager.GetActiveScene().buildIndex);
            MessageUtil.SetLoadingState(annotation, state);
            m_DefaultAnnotationLoadingState = state;
            return(m_AdditionalLibraryMethods.SetCurrentAnnotation(annotation));
        }
        ErrorCode SetDefaultAnnotation(MessageUtil.LoadingState state)
        {
            var annotation = new TAnnotation();

            MessageUtil.SetScene(annotation, SceneManager.GetActiveScene().buildIndex);
            MessageUtil.SetLoadingState(annotation, state);
            m_DefaultAnnotationLoadingState = state;
            var errorCode = m_AdditionalLibraryMethods.SetCurrentAnnotation(annotation);

            if (errorCode != ErrorCode.Ok)
            {
                Debug.LogErrorFormat("SetCurrentAnnotation({0}) result is {1}", annotation, errorCode);
            }
            return(errorCode);
        }
예제 #3
0
        /// <summary>
        ///     Set loading state.
        ///     Use only for default annotation.
        ///     Set <see cref="MessageUtil.LoadingState.Loading"/> when loading is started.
        ///     <br/><b>Important:</b>
        ///     <list type="bullet">
        ///         <item> Don't forget to set <see cref="MessageUtil.LoadingState.NotLoading"/> when loading is finished. </item>
        ///         <item> Frame information will not be recorded during loading. </item>
        ///     </list>
        /// </summary>
        /// <param name="state">loading state</param>
        /// <returns>
        ///     <see cref="ErrorCode.TuningforkNotInitialized"/> if plugin is not initialized.
        ///     <see cref="ErrorCode.InvalidMode"/> if using with custom annotation mode.
        ///     <see cref="ErrorCode.Ok"/> on success.
        /// </returns>
        public ErrorCode SetLoadingState(MessageUtil.LoadingState state)
        {
            if (m_SetupConfig == null)
            {
                return(ErrorCode.TuningforkNotInitialized);
            }

            if (!m_SetupConfig.useAdvancedAnnotations)
            {
                return(SetDefaultAnnotation(state));
            }

            Debug.LogWarning("Android Performance Tuner: " +
                             "Don't set loading state when custom annotation enabled");
            return(ErrorCode.InvalidMode);
        }
예제 #4
0
 public ErrorCode SetLoadingState(MessageUtil.LoadingState state)
 {
     Debug.LogWarning("LoadingState is deprecated, you should use \"StartRecordingLoadingTime\" " +
                      "and \"StopRecordingLoadingTime\" instead");
     return(ErrorCode.InvalidMode);
 }