fix: compile error on runtime build (#450)

This commit is contained in:
anatawa12 2023-09-25 22:57:45 +09:00 committed by GitHub
parent 8a770de016
commit 37309125ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 6 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,5 @@
using System.Runtime.CompilerServices;
using Unity.Burst;
using UnityEditor;
using UnityEngine;
namespace nadena.dev.modular_avatar.core.armature_lock
@ -27,7 +26,9 @@ namespace nadena.dev.modular_avatar.core.armature_lock
public void ToTransform(Transform bone)
{
Undo.RecordObject(bone, Undo.GetCurrentGroupName());
#if UNITY_EDITOR
UnityEditor.Undo.RecordObject(bone, UnityEditor.Undo.GetCurrentGroupName());
#endif
bone.localPosition = localPosition;
bone.localRotation = localRotation;
bone.localScale = localScale;

View File

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