-
Notifications
You must be signed in to change notification settings - Fork 418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AvatarBuilder.BuildHumanAvatar には隠れたボーン名 HumanTrait.BoneName が必用 #1800
Conversation
HumanBodyBones.ToString != HumanTrait.BoneName であることに注意(指のみ。Space)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
コメント以外はLGTM 👍
cashedHumanTraitBoneName[i] = boneNames[i].Replace(" ", ""); | ||
} | ||
} | ||
// HumanTrait.BoneName 呼び出し毎にGCが発生 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
コメントが雑になってわかりにくくなってる?
コメント増量。 |
@@ -9,6 +9,7 @@ | |||
|
|||
namespace UniHumanoid | |||
{ | |||
// TODO: BoneLimit.cs に分ける(v0.104以降) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
diff が分かりにくくなるので、あとで
// * HumanTrait.BoneName | ||
// * traitName.Replace | ||
// * Enum.Parse | ||
// |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HumanTrait.BoneName が問題の根源
traitName => (HumanBodyBones)Enum.Parse(typeof(HumanBodyBones), traitName.Replace(" ", "")), | ||
traitName => traitName); | ||
|
||
// 逆引き |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enum.Parse がGC出ると書いた手前、逆引きもキャッシュすることにした
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
fixed #1799
HumanBodyBones.ToString != HumanTrait.BoneName であることに注意(指のみ。Space)。
分かりにくいので変数名、関数名をくどい感じにしました。
コード整理したら
HumanBodyBones
=>HumanTrait.BoneName
になった。要するに
Dictionary<HumanBodyBones, string>