This commit is contained in:
左右看
2022-09-29 02:28:44 +08:00
3 changed files with 37 additions and 35 deletions
+11 -11
View File
@@ -2635,7 +2635,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5} m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5} m_AnchorMax: {x: 1, y: 0.5}
m_AnchoredPosition: {x: -0.5, y: 252.35} m_AnchoredPosition: {x: -0.5, y: 242}
m_SizeDelta: {x: -85, y: 30} m_SizeDelta: {x: -85, y: 30}
m_Pivot: {x: 0.5, y: 1} m_Pivot: {x: 0.5, y: 1}
--- !u!114 &212377233 --- !u!114 &212377233
@@ -3871,7 +3871,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1} m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1} m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: -104.3} m_AnchoredPosition: {x: 0, y: -99}
m_SizeDelta: {x: -224, y: 30} m_SizeDelta: {x: -224, y: 30}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &292348637 --- !u!114 &292348637
@@ -13368,7 +13368,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1} m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1} m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: -151.5} m_AnchoredPosition: {x: 0, y: -149}
m_SizeDelta: {x: -16, y: 25} m_SizeDelta: {x: -16, y: 25}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &994851660 --- !u!114 &994851660
@@ -13416,7 +13416,7 @@ MonoBehaviour:
m_HandleRect: {fileID: 1647140268} m_HandleRect: {fileID: 1647140268}
m_Direction: 0 m_Direction: 0
m_MinValue: 0 m_MinValue: 0
m_MaxValue: 1 m_MaxValue: 2
m_WholeNumbers: 0 m_WholeNumbers: 0
m_Value: 1 m_Value: 1
m_OnValueChanged: m_OnValueChanged:
@@ -15672,7 +15672,7 @@ MonoBehaviour:
m_HandleRect: {fileID: 1882365342} m_HandleRect: {fileID: 1882365342}
m_Direction: 2 m_Direction: 2
m_Value: 1 m_Value: 1
m_Size: 0.8225314 m_Size: 0.74480647
m_NumberOfSteps: 0 m_NumberOfSteps: 0
m_OnValueChanged: m_OnValueChanged:
m_PersistentCalls: m_PersistentCalls:
@@ -20819,8 +20819,8 @@ RectTransform:
m_Father: {fileID: 1145728918} m_Father: {fileID: 1145728918}
m_RootOrder: 0 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0} m_AnchorMin: {x: 0.5, y: 0}
m_AnchorMax: {x: 1, y: 1} m_AnchorMax: {x: 0.5, y: 1}
m_AnchoredPosition: {x: -10, y: 0} m_AnchoredPosition: {x: -10, y: 0}
m_SizeDelta: {x: 20, y: -4} m_SizeDelta: {x: 20, y: -4}
m_Pivot: {x: 0, y: 0.5} m_Pivot: {x: 0, y: 0.5}
@@ -24493,7 +24493,7 @@ RectTransform:
m_RootOrder: 0 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1} m_AnchorMax: {x: 0.5, y: 1}
m_AnchoredPosition: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 10, y: 0} m_SizeDelta: {x: 10, y: 0}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
@@ -32306,7 +32306,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1} m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: -50} m_AnchoredPosition: {x: 0, y: -80}
m_SizeDelta: {x: 0, y: -100} m_SizeDelta: {x: 0, y: -100}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &6878219667498913897 --- !u!114 &6878219667498913897
@@ -32703,7 +32703,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5} m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5} m_AnchorMax: {x: 1, y: 0.5}
m_AnchoredPosition: {x: -0.5, y: 219} m_AnchoredPosition: {x: -0.5, y: 201}
m_SizeDelta: {x: -85, y: 30} m_SizeDelta: {x: -85, y: 30}
m_Pivot: {x: 0.5, y: 1} m_Pivot: {x: 0.5, y: 1}
--- !u!114 &6878219667641514016 --- !u!114 &6878219667641514016
@@ -34109,7 +34109,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1} m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: -50} m_AnchoredPosition: {x: 0, y: -80}
m_SizeDelta: {x: 0, y: -100} m_SizeDelta: {x: 0, y: -100}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &6878219668012581467 --- !u!114 &6878219668012581467
+6 -4
View File
@@ -180,7 +180,8 @@ public class UmaViewerBuilder : MonoBehaviour
string head_costumeId; string head_costumeId;
int tailId = (int)charaData["tailModelId"]; int tailId = (int)charaData["tailModelId"];
if (id == 9006) tailId = -1;//The tailId of 9006 is 1, but the character has no tail //The tailId of 9006 is 1, but the character has no tail
if (id == 9006) tailId = -1;
if (UI.isHeadFix && CurrentHead != null) if (UI.isHeadFix && CurrentHead != null)
{ {
@@ -911,10 +912,11 @@ public class UmaViewerBuilder : MonoBehaviour
RecursiveLoadAsset(motion_s); RecursiveLoadAsset(motion_s);
} }
CurrentUMAContainer.OverrideController["clip_1"] = CurrentUMAContainer.OverrideController["clip_2"];
var lastTime = CurrentUMAContainer.UmaAnimator.GetCurrentAnimatorStateInfo(0).normalizedTime; var lastTime = CurrentUMAContainer.UmaAnimator.GetCurrentAnimatorStateInfo(0).normalizedTime;
CurrentUMAContainer.UmaAnimator.Play("motion_1", 0, lastTime); CurrentUMAContainer.OverrideController["clip_1"] = CurrentUMAContainer.OverrideController["clip_2"];
CurrentUMAContainer.OverrideController["clip_2"] = clip; CurrentUMAContainer.OverrideController["clip_2"] = clip;
CurrentUMAContainer.UmaAnimator.Play("motion_1", 0, lastTime);
CurrentUMAContainer.UmaAnimator.SetTrigger(needTransit ? "next_s" : "next"); CurrentUMAContainer.UmaAnimator.SetTrigger(needTransit ? "next_s" : "next");
} }
else if(clip.name.EndsWith("_S")) else if(clip.name.EndsWith("_S"))
@@ -939,9 +941,9 @@ public class UmaViewerBuilder : MonoBehaviour
else else
{ {
CurrentUMAContainer.UmaAnimator.Play("motion_1", 0, lastTime); CurrentUMAContainer.UmaAnimator.Play("motion_1", 0, lastTime);
CurrentUMAContainer.UmaAnimator.SetTrigger(needTransit ? "next_s" : "next");
} }
CurrentUMAContainer.UmaAnimator.SetTrigger(needTransit ? "next_s" : "next");
} }
} }
+18 -18
View File
@@ -310,7 +310,6 @@ public class UmaViewerUI : MonoBehaviour
} }
} }
public void SetCriWare(bool value) public void SetCriWare(bool value)
{ {
isCriware = value; isCriware = value;
@@ -319,7 +318,6 @@ public class UmaViewerUI : MonoBehaviour
public void SetHeadFix(bool value) public void SetHeadFix(bool value)
{ {
isHeadFix = value; isHeadFix = value;
UnityEngine.Debug.Log(isHeadFix);
} }
void ListLiveSounds(int songid) void ListLiveSounds(int songid)
@@ -456,7 +454,8 @@ public class UmaViewerUI : MonoBehaviour
public void LoadedAnimation() public void LoadedAnimation()
{ {
AnimationSlider.value = 0f; if (!Builder.CurrentUMAContainer || !Builder.CurrentUMAContainer.UmaAnimator) return;
AnimationSlider.SetValueWithoutNotify(0);
// Reset settings by Panel // Reset settings by Panel
Builder.CurrentUMAContainer.UmaAnimator.speed = AnimationSpeedSlider.value; Builder.CurrentUMAContainer.UmaAnimator.speed = AnimationSpeedSlider.value;
} }
@@ -501,7 +500,6 @@ public class UmaViewerUI : MonoBehaviour
{ {
cySpring.EnablePhysics(isOn); cySpring.EnablePhysics(isOn);
} }
} }
} }
@@ -547,12 +545,12 @@ public class UmaViewerUI : MonoBehaviour
source.time = source.clip.length * val; source.time = source.clip.length * val;
} }
} }
} }
} }
public void AnimationPause() public void AnimationPause()
{ {
if (!Builder.CurrentUMAContainer || !Builder.CurrentUMAContainer.UmaAnimator) return;
if (Builder.OverrideController.animationClips.Length > 0) if (Builder.OverrideController.animationClips.Length > 0)
{ {
var animator = Builder.CurrentUMAContainer.UmaAnimator; var animator = Builder.CurrentUMAContainer.UmaAnimator;
@@ -577,6 +575,7 @@ public class UmaViewerUI : MonoBehaviour
public void AnimationProgressChange(float val) public void AnimationProgressChange(float val)
{ {
if (!Builder.CurrentUMAContainer || !Builder.CurrentUMAContainer.UmaAnimator) return;
var animator = Builder.CurrentUMAContainer.UmaAnimator; var animator = Builder.CurrentUMAContainer.UmaAnimator;
if (animator != null) if (animator != null)
{ {
@@ -590,12 +589,9 @@ public class UmaViewerUI : MonoBehaviour
public void AnimationSpeedChange(float val) public void AnimationSpeedChange(float val)
{ {
var animator = Builder.CurrentUMAContainer.UmaAnimator; AnimationSpeedText.text = string.Format("Animation Speed: {0:F2}", val);
if (animator != null) if (!Builder.CurrentUMAContainer || !Builder.CurrentUMAContainer.UmaAnimator) return;
{ Builder.CurrentUMAContainer.UmaAnimator.speed = val;
Builder.CurrentUMAContainer.UmaAnimator.speed = val;
AnimationSpeedText.text = $"Animation Speed: {val}";
}
} }
private void Update() private void Update()
@@ -612,15 +608,19 @@ public class UmaViewerUI : MonoBehaviour
} }
} }
if (Builder.CurrentUMAContainer != null && Builder.CurrentUMAContainer.UmaAnimator != null && Builder.CurrentUMAContainer.OverrideController != null)
if (Builder.CurrentUMAContainer != null && Builder.CurrentUMAContainer.OverrideController != null)
{ {
var AnimeState = Builder.CurrentUMAContainer.UmaAnimator.GetCurrentAnimatorStateInfo(0); if(Builder.CurrentUMAContainer.OverrideController["clip_2"].name != "clip_2")
var AnimeClip = Builder.CurrentUMAContainer.OverrideController["clip_2"];
if (AnimeClip && Builder.CurrentUMAContainer.UmaAnimator.speed != 0)
{ {
AnimationTitleText.text = AnimeClip.name; var AnimeState = Builder.CurrentUMAContainer.UmaAnimator.GetCurrentAnimatorStateInfo(0);
AnimationProgressText.text = string.Format("{0} / {1}", ToTimeFormat(AnimeState.normalizedTime * AnimeClip.length), ToTimeFormat(AnimeClip.length)); var AnimeClip = Builder.CurrentUMAContainer.OverrideController["clip_2"];
AnimationSlider.SetValueWithoutNotify(AnimeState.normalizedTime); if (AnimeClip && Builder.CurrentUMAContainer.UmaAnimator.speed != 0)
{
AnimationTitleText.text = AnimeClip.name;
AnimationProgressText.text = string.Format("{0} / {1}", ToTimeFormat(Mathf.Repeat(AnimeState.normalizedTime, 1) * AnimeClip.length), ToTimeFormat(AnimeClip.length));
AnimationSlider.SetValueWithoutNotify(Mathf.Repeat(AnimeState.normalizedTime, 1));
}
} }
} }
} }