-
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.
Merge branch 'release/v7.3.0' into main
- Loading branch information
Showing
18 changed files
with
329 additions
and
42 deletions.
There are no files selected for viewing
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
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
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
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,13 @@ | ||
namespace ReadyPlayerMe.AvatarCreator | ||
{ | ||
public struct CreatedUser | ||
{ | ||
public string Id; | ||
public string Name; | ||
public string Email; | ||
public string Token; | ||
public string RefreshToken; | ||
public string LastModifiedAvatarId; | ||
} | ||
} | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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
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
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
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
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
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,52 @@ | ||
using UnityEngine; | ||
|
||
namespace ReadyPlayerMe | ||
{ | ||
/// <summary> | ||
/// This class is responsible for destroying all SkinnedMeshRenderer components and their associated resources (meshes, materials, and textures) | ||
/// when the GameObject is destroyed to prevent memory leaks. | ||
/// </summary> | ||
public class DestroyMesh : MonoBehaviour | ||
{ | ||
private SkinnedMeshRenderer[] meshes; | ||
|
||
/// <summary> | ||
/// Called when the script instance is being loaded. | ||
/// Initializes the meshes array by finding all SkinnedMeshRenderer components in the child objects of the current GameObject. | ||
/// </summary> | ||
private void Awake() | ||
{ | ||
meshes = GetComponentsInChildren<SkinnedMeshRenderer>(); | ||
} | ||
|
||
/// <summary> | ||
/// Called when the GameObject is destroyed. | ||
/// Destroys all associated SkinnedMeshRenderer meshes, materials, and textures to ensure proper memory management. | ||
/// </summary> | ||
private void OnDestroy() | ||
{ | ||
foreach (var mesh in meshes) | ||
{ | ||
var materials = mesh.sharedMaterials; | ||
|
||
foreach (var material in materials) | ||
{ | ||
if (material == null) continue; | ||
|
||
foreach (var property in material.GetTexturePropertyNames()) | ||
{ | ||
var texture = material.GetTexture(property); | ||
|
||
if (texture == null) continue; | ||
|
||
Destroy(texture); | ||
} | ||
|
||
Destroy(material); | ||
} | ||
|
||
Destroy(mesh.sharedMesh); | ||
} | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.