Code cleanup.

This commit is contained in:
2023-05-19 23:17:32 +08:00
parent ed60859406
commit a8231f7c86
3 changed files with 6 additions and 9 deletions

View File

@@ -1,5 +1,4 @@
using Cryville.Common;
using Cryville.Common.Unity.UI;
using System;
using TMPro;
using UnityEngine;
@@ -16,7 +15,6 @@ namespace Cryville.Crtr.Browsing {
ChartDetail _data;
GameObject _placeholder;
GameObject _outerContent;
DockOccupiedRatioLayoutGroup _outerContentGroup;
Transform _content;
Image _cover;
TMP_Text _title;
@@ -26,7 +24,6 @@ namespace Cryville.Crtr.Browsing {
base.Awake();
_placeholder = transform.Find("__placeholder__").gameObject;
_outerContent = transform.Find("__content__").gameObject;
_outerContentGroup = _outerContent.GetComponent<DockOccupiedRatioLayoutGroup>();
_content = _outerContent.transform.Find("__content__");
_cover = _content.Find("Cover").GetComponent<Image>();
_title = _content.Find("Texts/Title").GetComponent<TMP_Text>();

View File

@@ -7,7 +7,7 @@ namespace Cryville.Crtr {
public class ChartHandler : TransformHandler {
protected override TransformHandler Parent { get { return null; } }
Chart chart;
readonly Chart chart;
readonly List<LibavFileAudioSource> sounds = new List<LibavFileAudioSource>();
public ChartHandler(Chart _chart) {

View File

@@ -140,13 +140,13 @@ namespace Cryville.Crtr.Components {
verts = _vertPool.Rent(vc * vcpsec);
uvs = _uvPool.Rent(vc * vcpsec);
int i = 0; int t = 0; float l = 0; int m = 0;
if (head.Frame != null) { m++; GenerateMeshTo(verts, uvs, out trih, head, ref i, ref t, ref l, 0, headLength, vcpsec, hvc); }
m++; GenerateMeshTo(verts, uvs, out trib, body, ref i, ref t, ref l, headLength, sumLength - tailLength, vcpsec, hvc + bvc);
if (tail.Frame != null) { m++; GenerateMeshTo(verts, uvs, out trit, tail, ref i, ref t, ref l, sumLength - tailLength, sumLength, vcpsec, vc); }
int i = 0; int t = 0; float l = 0;
if (head.Frame != null) { GenerateMeshTo(verts, uvs, out trih, head, ref i, ref t, ref l, 0, headLength, vcpsec, hvc); }
GenerateMeshTo(verts, uvs, out trib, body, ref i, ref t, ref l, headLength, sumLength - tailLength, vcpsec, hvc + bvc);
if (tail.Frame != null) { GenerateMeshTo(verts, uvs, out trit, tail, ref i, ref t, ref l, sumLength - tailLength, sumLength, vcpsec, vc); }
mesh.Mesh.subMeshCount = 3;
m = 0;
int m = 0;
mesh.Mesh.SetVertices(verts);
mesh.Mesh.SetUVs(0, uvs);
mesh.Mesh.SetTriangles(head.Frame == null ? _emptyTris : trih, m++);