-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
- Loading branch information
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
%YAML 1.1 | ||
%TAG !u! tag:unity3d.com,2011: | ||
--- !u!1 &8689199224619827205 | ||
GameObject: | ||
m_ObjectHideFlags: 0 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInstance: {fileID: 0} | ||
m_PrefabAsset: {fileID: 0} | ||
serializedVersion: 6 | ||
m_Component: | ||
- component: {fileID: 336921771382832073} | ||
- component: {fileID: 3270854224572761495} | ||
- component: {fileID: 294420130874679028} | ||
- component: {fileID: 3265452433697327105} | ||
m_Layer: 5 | ||
m_Name: Danmaku | ||
m_TagString: Untagged | ||
m_Icon: {fileID: 0} | ||
m_NavMeshLayer: 0 | ||
m_StaticEditorFlags: 0 | ||
m_IsActive: 1 | ||
--- !u!224 &336921771382832073 | ||
RectTransform: | ||
m_ObjectHideFlags: 0 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInstance: {fileID: 0} | ||
m_PrefabAsset: {fileID: 0} | ||
m_GameObject: {fileID: 8689199224619827205} | ||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} | ||
m_LocalPosition: {x: 0, y: 0, z: 0} | ||
m_LocalScale: {x: 1, y: 1, z: 1} | ||
m_ConstrainProportionsScale: 0 | ||
m_Children: [] | ||
m_Father: {fileID: 0} | ||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} | ||
m_AnchorMin: {x: 0.5, y: 0.5} | ||
m_AnchorMax: {x: 0.5, y: 0.5} | ||
m_AnchoredPosition: {x: 159.41, y: -55} | ||
m_SizeDelta: {x: 428.12, y: 163.7} | ||
m_Pivot: {x: 0.5, y: 0.5} | ||
--- !u!222 &3270854224572761495 | ||
CanvasRenderer: | ||
m_ObjectHideFlags: 0 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInstance: {fileID: 0} | ||
m_PrefabAsset: {fileID: 0} | ||
m_GameObject: {fileID: 8689199224619827205} | ||
m_CullTransparentMesh: 1 | ||
--- !u!114 &294420130874679028 | ||
MonoBehaviour: | ||
m_ObjectHideFlags: 0 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInstance: {fileID: 0} | ||
m_PrefabAsset: {fileID: 0} | ||
m_GameObject: {fileID: 8689199224619827205} | ||
m_Enabled: 1 | ||
m_EditorHideFlags: 0 | ||
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} | ||
m_Name: | ||
m_EditorClassIdentifier: | ||
m_Material: {fileID: 0} | ||
m_Color: {r: 1, g: 1, b: 1, a: 1} | ||
m_RaycastTarget: 1 | ||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} | ||
m_Maskable: 1 | ||
m_OnCullStateChanged: | ||
m_PersistentCalls: | ||
m_Calls: [] | ||
m_FontData: | ||
m_Font: {fileID: 12800000, guid: 8cb6273d740045b4aa08f9875bbd7601, type: 3} | ||
m_FontSize: 18 | ||
m_FontStyle: 0 | ||
m_BestFit: 1 | ||
m_MinSize: 5 | ||
m_MaxSize: 20 | ||
m_Alignment: 0 | ||
m_AlignByGeometry: 0 | ||
m_RichText: 1 | ||
m_HorizontalOverflow: 0 | ||
m_VerticalOverflow: 0 | ||
m_LineSpacing: 1 | ||
m_Text: 'asdjasdjhaskjdhaksjdh | ||
aksjdhaksjdhaksjdh | ||
kajshdsakjdhaksjd | ||
kajshdkajsdhkasjdh | ||
akjsdhkajdhadakjsdhkajhdakjsdhakjhdak' | ||
--- !u!114 &3265452433697327105 | ||
MonoBehaviour: | ||
m_ObjectHideFlags: 0 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInstance: {fileID: 0} | ||
m_PrefabAsset: {fileID: 0} | ||
m_GameObject: {fileID: 8689199224619827205} | ||
m_Enabled: 1 | ||
m_EditorHideFlags: 0 | ||
m_Script: {fileID: 11500000, guid: 44c17983a4705464aaadf6e9d5190d0e, type: 3} | ||
m_Name: | ||
m_EditorClassIdentifier: |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
using UnityEngine.UI; | ||
|
||
public class DanmakuDisplayer : MonoBehaviour | ||
{ | ||
RectTransform rt; | ||
// Start is called before the first frame update | ||
void Start() | ||
{ | ||
rt = GetComponent<RectTransform>(); | ||
rt.anchoredPosition = new Vector2(770f, -55f); | ||
} | ||
|
||
// Update is called once per frame | ||
void Update() | ||
{ | ||
rt.anchoredPosition -= new Vector2(300f * Time.deltaTime,0f); | ||
if (rt.anchoredPosition.x < -1000f) Destroy(gameObject); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
using TMPro; | ||
using UnityEngine.UI; | ||
using MajdataPlay.Types; | ||
using Cysharp.Threading.Tasks; | ||
using MajdataPlay.Net; | ||
using System.Text.Json; | ||
|
||
public class SubInfoDisplayer : MonoBehaviour | ||
{ | ||
public TMP_Text id_text; | ||
public TMP_Text good_text; | ||
public GameObject commentPrefab; | ||
List<GameObject> comments = new List<GameObject>(); | ||
// Start is called before the first frame update | ||
public void RefreshContent(SongDetail song) | ||
{ | ||
if (song.isOnline) | ||
{ | ||
id_text.text = "ID: " + song.OnlineId; | ||
StopAllCoroutines(); | ||
foreach(var obj in comments) | ||
{ | ||
Destroy(obj); | ||
} | ||
comments.Clear(); | ||
StartCoroutine( GetOnlineInteraction(song)); | ||
} | ||
else | ||
{ | ||
id_text.text = ""; | ||
good_text.text = ""; | ||
} | ||
} | ||
|
||
IEnumerator GetOnlineInteraction(SongDetail song) | ||
{ | ||
var client = HttpTransporter.ShareClient; | ||
var interactUrl = song.ApiEndpoint.Url + "/Interact/" + song.OnlineId; | ||
var task = client.GetStringAsync(interactUrl); | ||
while(!task.IsCompleted) | ||
{ | ||
yield return new WaitForEndOfFrame(); | ||
} | ||
var intjson = task.Result; | ||
|
||
var list = JsonSerializer.Deserialize<MajNetSongInteract>(intjson); | ||
good_text.text = "ÔÞ: " + list.LikeList.Length +" ÆÀ: " +list.CommentsList.Count; | ||
|
||
foreach ( var comment in list.CommentsList ) | ||
{ | ||
var text = comment.Key + "\n" + comment.Value + "\n"; | ||
var obj = Instantiate(commentPrefab,gameObject.transform); | ||
comments.Add(obj); | ||
obj.GetComponent<Text>().text = text; | ||
yield return new WaitForSeconds(2f); | ||
} | ||
|
||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.