fix: compile error in build

This commit is contained in:
bd_ 2023-09-25 22:56:21 +09:00
parent 8a770de016
commit 93adbfd85d
3 changed files with 10 additions and 2 deletions

View File

@ -74,7 +74,9 @@ namespace nadena.dev.modular_avatar.core.armature_lock
public ArmatureLockController(ModularAvatarMergeArmature mama, GetTransformsDelegate getTransforms)
{
#if UNITY_EDITOR
AssemblyReloadEvents.beforeAssemblyReload += Dispose;
#endif
this._mama = mama;
this._getTransforms = getTransforms;

View File

@ -1,6 +1,8 @@
using System.Runtime.CompilerServices;
using Unity.Burst;
#if UNITY_EDITOR
using UnityEditor;
#endif
using UnityEngine;
namespace nadena.dev.modular_avatar.core.armature_lock
@ -27,7 +29,9 @@ namespace nadena.dev.modular_avatar.core.armature_lock
public void ToTransform(Transform bone)
{
#if UNITY_EDITOR
Undo.RecordObject(bone, Undo.GetCurrentGroupName());
#endif
bone.localPosition = localPosition;
bone.localRotation = localRotation;
bone.localScale = localScale;

View File

@ -1,6 +1,8 @@
using System;
using System.Collections.Generic;
#if UNITY_EDITOR
using UnityEditor;
#endif
using UnityEngine;
using VRC.SDKBase;
@ -121,9 +123,9 @@ namespace nadena.dev.modular_avatar.core.ArmatureAwase
if (deltaPos.sqrMagnitude < EPSILON && deltaRot < EPSILON && deltaScale < EPSILON)
{
Matrix4x4 childNewLocal = parent.worldToLocalMatrix * state.childWorld;
#if UNITY_EDITOR
Undo.RecordObject(child, Undo.GetCurrentGroupName());
#endif
child.localPosition = childNewLocal.MultiplyPoint(Vector3.zero);
child.localRotation = childNewLocal.rotation;
child.localScale = childNewLocal.lossyScale;