void ResetAnimationSampler()
        {
            DisableDisplayTrajectory();

            clip         = null;
            sourceAvatar = null;

            if (clipAssetCallbacks != null)
            {
                clipAssetCallbacks.Dispose();
                clipAssetCallbacks = null;
            }

            if (sampler != null)
            {
                sampler.Dispose();
                sampler = null;
            }

            previousTime = -1.0f;
        }
        bool InitAnimationSampler(TaggedAnimationClip clip)
        {
            this.clip = clip;

            if (clipAssetCallbacks != null)
            {
                clipAssetCallbacks.Dispose();
            }

            AnimationClip animationClip = clip.GetOrLoadClipSync();

            clipAssetCallbacks = new AssetPostprocessCallbacks(animationClip);
            clipAssetCallbacks.importDelegate = OnClipReimport;
            clipAssetCallbacks.deleteDelegate = OnClipDelete;

            sourceAvatar = clip.RetargetSourceAvatar;

            if (sampler != null)
            {
                sampler.Dispose();
                sampler = null;
            }

            try
            {
                sampler = new AnimationSampler(targetRig, animationClip);
            }
            catch (Exception e)
            {
                Debug.LogError(e.Message);
                return(false);
            }

            previousTime = -1.0f;

            return(true);
        }