mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2024-12-29 18:55:06 +08:00
fix: incorrect scaling for Visible Head Accessory (#412)
This commit is contained in:
parent
8251f3fcf7
commit
b155202714
@ -85,12 +85,6 @@ namespace nadena.dev.modular_avatar.core.editor
|
|||||||
{
|
{
|
||||||
var proxy = CreateProxy();
|
var proxy = CreateProxy();
|
||||||
|
|
||||||
var xform = target.transform;
|
|
||||||
|
|
||||||
var pscale = proxy.lossyScale;
|
|
||||||
var oscale = xform.lossyScale;
|
|
||||||
xform.localScale = new Vector3(oscale.x / pscale.x, oscale.y / pscale.y, oscale.z / pscale.z);
|
|
||||||
|
|
||||||
target.transform.SetParent(proxy, true);
|
target.transform.SetParent(proxy, true);
|
||||||
|
|
||||||
didWork = true;
|
didWork = true;
|
||||||
@ -122,6 +116,7 @@ namespace nadena.dev.modular_avatar.core.editor
|
|||||||
obj.transform.localPosition = src.localPosition;
|
obj.transform.localPosition = src.localPosition;
|
||||||
obj.transform.localRotation = src.localRotation;
|
obj.transform.localRotation = src.localRotation;
|
||||||
obj.transform.localScale = src.localScale;
|
obj.transform.localScale = src.localScale;
|
||||||
|
Debug.Log($"src.localScale = {src.localScale} obj.transform.localScale = {obj.transform.localScale}");
|
||||||
|
|
||||||
var constraint = obj.AddComponent<ParentConstraint>();
|
var constraint = obj.AddComponent<ParentConstraint>();
|
||||||
constraint.AddSource(new ConstraintSource()
|
constraint.AddSource(new ConstraintSource()
|
||||||
@ -136,6 +131,8 @@ namespace nadena.dev.modular_avatar.core.editor
|
|||||||
|
|
||||||
_proxyHead = obj.transform;
|
_proxyHead = obj.transform;
|
||||||
|
|
||||||
|
// TODO - lock proxy scale to head scale in animation?
|
||||||
|
|
||||||
return obj.transform;
|
return obj.transform;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user