-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SDK-658] Feature/asset store updates (#195)
- this PR includes a number of changes to make the SDK more compliant with the unity Asset store requirements - 1 script was edited so that it was wrapped in RPM namespace - removed the Ready Player Me custom file menu, now it is under Tools (as required by asset store) - fixed some issues related to paths like in the Graphics Setting Utility
- Loading branch information
1 parent
bf39b05
commit e2afffb
Showing
7 changed files
with
57 additions
and
54 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
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 |
---|---|---|
@@ -1,47 +1,50 @@ | ||
using UnityEngine; | ||
|
||
/// <summary> | ||
/// This static class contains useful helper functions used check and access | ||
/// bones of a loaded avatar. | ||
/// </summary> | ||
public static class AvatarBoneHelper | ||
namespace ReadyPlayerMe.Core | ||
{ | ||
private const string ARMATURE_HIPS_LEFT_UP_LEG_BONE_NAME = "Armature/Hips/LeftUpLeg"; | ||
private const string HALF_BODY_LEFT_EYE_BONE_NAME = "Armature/Hips/Spine/Neck/Head/LeftEye"; | ||
private const string FULL_BODY_LEFT_EYE_BONE_NAME = "Armature/Hips/Spine/Spine1/Spine2/Neck/Head/LeftEye"; | ||
private const string HALF_BODY_RIGHT_EYE_BONE_NAME = "Armature/Hips/Spine/Neck/Head/RightEye"; | ||
private const string FULL_BODY_RIGHT_EYE_BONE_NAME = "Armature/Hips/Spine/Spine1/Spine2/Neck/Head/RightEye"; | ||
|
||
/// <summary> | ||
/// This is a legacy function that can be used to check if an | ||
/// avatar is fullbody and the object does not have an <seealso cref="AvatarData"/> component | ||
/// This static class contains useful helper functions used check and access | ||
/// bones of a loaded avatar. | ||
/// </summary> | ||
/// <param name="avatarRoot">The root transform of the avatar GameObject</param> | ||
/// <returns>True if it finds a bone only present in full body avatars</returns> | ||
public static bool IsFullBodySkeleton(Transform avatarRoot) | ||
public static class AvatarBoneHelper | ||
{ | ||
return avatarRoot.Find(ARMATURE_HIPS_LEFT_UP_LEG_BONE_NAME); | ||
} | ||
private const string ARMATURE_HIPS_LEFT_UP_LEG_BONE_NAME = "Armature/Hips/LeftUpLeg"; | ||
private const string HALF_BODY_LEFT_EYE_BONE_NAME = "Armature/Hips/Spine/Neck/Head/LeftEye"; | ||
private const string FULL_BODY_LEFT_EYE_BONE_NAME = "Armature/Hips/Spine/Spine1/Spine2/Neck/Head/LeftEye"; | ||
private const string HALF_BODY_RIGHT_EYE_BONE_NAME = "Armature/Hips/Spine/Neck/Head/RightEye"; | ||
private const string FULL_BODY_RIGHT_EYE_BONE_NAME = "Armature/Hips/Spine/Spine1/Spine2/Neck/Head/RightEye"; | ||
|
||
/// <summary> | ||
/// Searches the avatar transform hierarchy for the left eye bone | ||
/// </summary> | ||
/// <param name="avatarRoot">The root transform of the avatar GameObject</param> | ||
/// <param name="isFullBody">Set to true for fullbody avatar.</param> | ||
/// <returns>The transform of the left eye bone or null if not found.</returns> | ||
public static Transform GetLeftEyeBone(Transform avatarRoot, bool isFullBody) | ||
{ | ||
return avatarRoot.Find(isFullBody ? FULL_BODY_LEFT_EYE_BONE_NAME : HALF_BODY_LEFT_EYE_BONE_NAME); | ||
} | ||
/// <summary> | ||
/// This is a legacy function that can be used to check if an | ||
/// avatar is fullbody and the object does not have an <seealso cref="AvatarData"/> component | ||
/// </summary> | ||
/// <param name="avatarRoot">The root transform of the avatar GameObject</param> | ||
/// <returns>True if it finds a bone only present in full body avatars</returns> | ||
public static bool IsFullBodySkeleton(Transform avatarRoot) | ||
{ | ||
return avatarRoot.Find(ARMATURE_HIPS_LEFT_UP_LEG_BONE_NAME); | ||
} | ||
|
||
/// <summary> | ||
/// Searches the avatar transform hierarchy for the right eye bone | ||
/// </summary> | ||
/// <param name="avatarRoot">The root transform of the avatar GameObject</param> | ||
/// <param name="isFullBody">Set to true for fullbody avatar.</param> | ||
/// <returns>The transform of the right eye bone or null if not found.</returns> | ||
public static Transform GetRightEyeBone(Transform avatarRoot, bool isFullBody) | ||
{ | ||
return avatarRoot.Find(isFullBody ? FULL_BODY_RIGHT_EYE_BONE_NAME : HALF_BODY_RIGHT_EYE_BONE_NAME); | ||
/// <summary> | ||
/// Searches the avatar transform hierarchy for the left eye bone | ||
/// </summary> | ||
/// <param name="avatarRoot">The root transform of the avatar GameObject</param> | ||
/// <param name="isFullBody">Set to true for fullbody avatar.</param> | ||
/// <returns>The transform of the left eye bone or null if not found.</returns> | ||
public static Transform GetLeftEyeBone(Transform avatarRoot, bool isFullBody) | ||
{ | ||
return avatarRoot.Find(isFullBody ? FULL_BODY_LEFT_EYE_BONE_NAME : HALF_BODY_LEFT_EYE_BONE_NAME); | ||
} | ||
|
||
/// <summary> | ||
/// Searches the avatar transform hierarchy for the right eye bone | ||
/// </summary> | ||
/// <param name="avatarRoot">The root transform of the avatar GameObject</param> | ||
/// <param name="isFullBody">Set to true for fullbody avatar.</param> | ||
/// <returns>The transform of the right eye bone or null if not found.</returns> | ||
public static Transform GetRightEyeBone(Transform avatarRoot, bool isFullBody) | ||
{ | ||
return avatarRoot.Find(isFullBody ? FULL_BODY_RIGHT_EYE_BONE_NAME : HALF_BODY_RIGHT_EYE_BONE_NAME); | ||
} | ||
} | ||
} |