Example #1
0
    private void OnFaceSnapshotReady(Asset_Texture texture)
    {
        if (faceSnapshot != null)
        {
            Destroy(faceSnapshot);
        }

        if (texture != null)
        {
            faceSnapshot = texture.texture;
        }

        OnUpdate?.Invoke(this);
        OnFaceSnapshotReadyEvent?.Invoke(faceSnapshot);
    }
Example #2
0
    public void OverrideAvatar(AvatarModel newModel, Texture2D newFaceSnapshot)
    {
        if (model?.snapshots != null)
        {
            if (thumbnailPromise != null)
            {
                ThumbnailsManager.ForgetThumbnail(thumbnailPromise);
                thumbnailPromise = null;
            }

            OnFaceSnapshotReady(null);
        }

        model.avatar.CopyFrom(newModel);
        this.faceSnapshot = newFaceSnapshot;
        OnUpdate?.Invoke(this);
        OnFaceSnapshotReadyEvent?.Invoke(faceSnapshot);
    }
Example #3
0
 private void OnFaceSnapshotReady(Sprite sprite)
 {
     faceSnapshot = sprite;
     OnUpdate?.Invoke(this);
     OnFaceSnapshotReadyEvent?.Invoke(sprite);
 }