78 lines
2.1 KiB
C#
78 lines
2.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.Events;
|
|
using UnityEngine.UI;
|
|
|
|
// Token: 0x02000011 RID: 17
|
|
public class FontOutViewer : MonoBehaviour, IFontOutViewer
|
|
{
|
|
// Token: 0x0600004A RID: 74 RVA: 0x00003030 File Offset: 0x00002230
|
|
private void Awake()
|
|
{
|
|
FontOutViewer.<>c__DisplayClass5_0 CS$<>8__locals1 = new FontOutViewer.<>c__DisplayClass5_0();
|
|
this._spriteInfos = new List<FontOutViewer.SpriteInfo>();
|
|
List<Sprite> list = Resources.LoadAll<Sprite>("TextView/END_SPACE_v100").ToList<Sprite>();
|
|
CS$<>8__locals1.infos = this._asset.spriteInfoList;
|
|
int i;
|
|
int k;
|
|
for (i = 0; i < CS$<>8__locals1.infos.Count; i = k + 1)
|
|
{
|
|
Sprite sprite2 = list.FirstOrDefault<Sprite>((Sprite sprite) => sprite.name == CS$<>8__locals1.infos[i].sprite.name);
|
|
this._spriteInfos.Add(new FontOutViewer.SpriteInfo
|
|
{
|
|
Name = CS$<>8__locals1.infos[i].name,
|
|
Sp = sprite2
|
|
});
|
|
k = i;
|
|
}
|
|
List<TMP_Dropdown.OptionData> list2 = new List<TMP_Dropdown.OptionData>();
|
|
for (int j = 0; j < this._spriteInfos.Count; j++)
|
|
{
|
|
list2.Add(new TMP_Dropdown.OptionData(this._spriteInfos[j].Name));
|
|
}
|
|
this._dropDown.Prepare("外字フォント一覧", list2);
|
|
this.ChangeSprite(0);
|
|
this._dropDown.AddListener(new UnityAction<int>(this.ChangeSprite));
|
|
}
|
|
|
|
// Token: 0x0600004B RID: 75 RVA: 0x0000316F File Offset: 0x0000236F
|
|
private void ChangeSprite(int index)
|
|
{
|
|
this._view.sprite = this._spriteInfos[index].Sp;
|
|
}
|
|
|
|
// Token: 0x0600004C RID: 76 RVA: 0x0000318D File Offset: 0x0000238D
|
|
public string GetName()
|
|
{
|
|
return this._dropDown.GetCurrentOption().text;
|
|
}
|
|
|
|
// Token: 0x04000020 RID: 32
|
|
[SerializeField]
|
|
private CustomDropDown _dropDown;
|
|
|
|
// Token: 0x04000021 RID: 33
|
|
[SerializeField]
|
|
private Image _view;
|
|
|
|
// Token: 0x04000022 RID: 34
|
|
[SerializeField]
|
|
private TMP_SpriteAsset _asset;
|
|
|
|
// Token: 0x04000023 RID: 35
|
|
private List<FontOutViewer.SpriteInfo> _spriteInfos;
|
|
|
|
// Token: 0x0200093F RID: 2367
|
|
private struct SpriteInfo
|
|
{
|
|
// Token: 0x04005EDB RID: 24283
|
|
public Sprite Sp;
|
|
|
|
// Token: 0x04005EDC RID: 24284
|
|
public string Name;
|
|
}
|
|
}
|