Optimize code
This commit is contained in:
@@ -230,7 +230,6 @@ public class UmaViewerBuilder : MonoBehaviour
|
||||
var firsehead = CurrentUMAContainer.Head;
|
||||
var FaceDriven = firsehead.GetComponent<AssetHolder>()._assetTable.list.Find(a => { return a.Key == "facial_target"; }).Value as FaceDrivenKeyTarget;
|
||||
CurrentUMAContainer.FaceDrivenKeyTargets = FaceDriven;
|
||||
FaceDriven.callBack = UmaViewerUI.Instance;
|
||||
FaceDriven.Initialize(firsehead.GetComponentsInChildren<Transform>().ToList());
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class UmaViewerUI : MonoBehaviour,FaceLoadCallBack
|
||||
public class UmaViewerUI : MonoBehaviour
|
||||
{
|
||||
public static UmaViewerUI Instance;
|
||||
private UmaViewerMain Main => UmaViewerMain.Instance;
|
||||
@@ -425,11 +425,6 @@ public class UmaViewerUI : MonoBehaviour,FaceLoadCallBack
|
||||
Camera.main.backgroundColor = color;
|
||||
}
|
||||
|
||||
public void CallBack(FaceDrivenKeyTarget target)
|
||||
{
|
||||
LoadFacialPanels(target);
|
||||
}
|
||||
|
||||
public void SetDynamicBoneEnable(bool isOn)
|
||||
{
|
||||
if (Builder.CurrentUMAContainer)
|
||||
|
||||
@@ -21,8 +21,6 @@ namespace Gallop
|
||||
public List<FacialMorph> MouthMorphs = new List<FacialMorph>();
|
||||
|
||||
Dictionary<Transform, Vector3> RotationRecorder = new Dictionary<Transform, Vector3>();
|
||||
|
||||
public FaceLoadCallBack callBack;
|
||||
public void Initialize(List<Transform> objs)
|
||||
{
|
||||
Objs = objs;
|
||||
@@ -39,10 +37,6 @@ namespace Gallop
|
||||
foreach (TrsArray trs in morph.trsArray)
|
||||
{
|
||||
trs.transform = Objs.Find(ani => ani.name.Equals(trs._path));
|
||||
if (i == 0 && trs.transform)
|
||||
{
|
||||
RotationRecorder[trs.transform] = trs._rotation;
|
||||
}
|
||||
}
|
||||
if (i == 0)
|
||||
{
|
||||
@@ -68,10 +62,6 @@ namespace Gallop
|
||||
foreach (TrsArray trs in morph.trsArray)
|
||||
{
|
||||
trs.transform = Objs.Find(ani => ani.name.Equals(trs._path));
|
||||
if(i == 0 && trs.transform)
|
||||
{
|
||||
RotationRecorder[trs.transform] = trs._rotation;
|
||||
}
|
||||
}
|
||||
if (i == 0)
|
||||
{
|
||||
@@ -97,10 +87,6 @@ namespace Gallop
|
||||
foreach (TrsArray trs in morph.trsArray)
|
||||
{
|
||||
trs.transform = Objs.Find(ani => ani.name.Equals(trs._path));
|
||||
if (i == 0 && trs.transform)
|
||||
{
|
||||
RotationRecorder[trs.transform] = trs._rotation;
|
||||
}
|
||||
}
|
||||
if (i == 0)
|
||||
{
|
||||
@@ -114,7 +100,7 @@ namespace Gallop
|
||||
}
|
||||
FacialReset();
|
||||
MouthMorphs[3].Weight = 1;
|
||||
if (callBack != null) { callBack.CallBack(this); }
|
||||
if (UmaViewerUI.Instance) { UmaViewerUI.Instance.LoadFacialPanels(this); }
|
||||
}
|
||||
|
||||
public void ChangeMorph()
|
||||
@@ -136,7 +122,7 @@ namespace Gallop
|
||||
ProcessMorph(morph);
|
||||
}
|
||||
|
||||
applyRotation();
|
||||
ApplyRotation();
|
||||
}
|
||||
private void ProcessMorph(FacialMorph morph)
|
||||
{
|
||||
@@ -205,12 +191,10 @@ namespace Gallop
|
||||
};
|
||||
}
|
||||
|
||||
applyRotation();
|
||||
ApplyRotation();
|
||||
}
|
||||
|
||||
//trs.transform.localEulerAngles
|
||||
|
||||
public void applyRotation(){
|
||||
public void ApplyRotation(){
|
||||
foreach (var trs in RotationRecorder)
|
||||
{
|
||||
trs.Key.localEulerAngles = RotationConvert.fromMaya(trs.Value);
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Gallop
|
||||
{
|
||||
public interface FaceLoadCallBack
|
||||
{
|
||||
public abstract void CallBack(FaceDrivenKeyTarget target);
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d7b0dd94109f6b445bd06165e34aea69
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user