-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adds image confirmation element
- Loading branch information
1 parent
face150
commit d049399
Showing
8 changed files
with
1,458 additions
and
739 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
Runtime/AvatarCreator/Elements/ImageConfirmationElement.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using UnityEngine; | ||
using UnityEngine.Events; | ||
using UnityEngine.UI; | ||
|
||
public class ImageConfirmationElement : MonoBehaviour | ||
{ | ||
[Header("Settings")] | ||
[SerializeField] private RawImage imageTextureTarget; | ||
|
||
[Header("Events")] | ||
public UnityEvent<Texture2D> onImageConfirmed; | ||
|
||
public void SetTexture(Texture2D texture) | ||
{ | ||
imageTextureTarget.texture = texture; | ||
} | ||
|
||
public void ConfirmPhoto() | ||
{ | ||
var texture = new Texture2D(imageTextureTarget.texture.width, imageTextureTarget.texture.height, TextureFormat.ARGB32, false); | ||
|
||
onImageConfirmed?.Invoke(texture); | ||
} | ||
} |
File renamed without changes.
21 changes: 0 additions & 21 deletions
21
Runtime/AvatarCreator/Elements/PhotoCaptureConfirmElement.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.