This commit is contained in:
2025-11-05 20:56:21 +08:00
parent c5c380d170
commit 5b31b629cd
10 changed files with 15 additions and 83 deletions

View File

@@ -1,10 +1,6 @@
using System.Collections;
using System.Collections.Generic;
using UnityEditor; using UnityEditor;
using UnityEngine; using UnityEngine;
using System;
using System.IO; using System.IO;
using System.Text;
public class CopyHotDll public class CopyHotDll

View File

@@ -1,8 +1,6 @@
using Cysharp.Threading.Tasks; using Cysharp.Threading.Tasks;
using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using YooAsset; using YooAsset;
using static UnityEngine.Rendering.VirtualTexturing.Debugging;
public class Boot : MonoBehaviour public class Boot : MonoBehaviour
{ {

View File

@@ -1,6 +1,4 @@
using Cysharp.Threading.Tasks; using Cysharp.Threading.Tasks;
using System;
using UnityEngine;
using YooAsset; using YooAsset;
public class MainOperation public class MainOperation
@@ -48,7 +46,7 @@ public class MainOperation
private void OnDownloadUpdate(DownloadUpdateData downloadUpdateData) private void OnDownloadUpdate(DownloadUpdateData downloadUpdateData)
{ {
float progress = (float)downloadUpdateData.CurrentDownloadBytes / downloadUpdateData.TotalDownloadBytes; float progress = (float)downloadUpdateData.CurrentDownloadBytes / downloadUpdateData.TotalDownloadBytes;
string sizeText = $"{(downloadUpdateData.CurrentDownloadBytes / 1024f / 1024f):F1}MB / {(downloadUpdateData.TotalDownloadBytes / 1024f / 1024f):F1}MB"; string sizeText = $"{operation.FormatFileSize(downloadUpdateData.CurrentDownloadBytes)} / {operation.FormatFileSize(downloadUpdateData.TotalDownloadBytes)}";
PatchEvent.UpdateProgress(progress); PatchEvent.UpdateProgress(progress);
PatchEvent.UpdateDownloadSize(sizeText); PatchEvent.UpdateDownloadSize(sizeText);
PatchEvent.UpdateStatus($"{data.packageName} 资源下载中..."); PatchEvent.UpdateStatus($"{data.packageName} 资源下载中...");

View File

@@ -1,5 +1,4 @@
using System; using System;
using UnityEngine;
public static class PatchEvent public static class PatchEvent
{ {

View File

@@ -1,4 +1,3 @@
using UnityEngine;
using Cysharp.Threading.Tasks; using Cysharp.Threading.Tasks;
using YooAsset; using YooAsset;
public class PatchManager : Singleton<PatchManager> public class PatchManager : Singleton<PatchManager>

View File

@@ -1,6 +1,4 @@
using Cysharp.Threading.Tasks; using Cysharp.Threading.Tasks;
using System;
using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using UnityEngine; using UnityEngine;
using YooAsset; using YooAsset;

View File

@@ -1,4 +1,3 @@
using UnityEngine; using UnityEngine;
public class Singleton<T> where T:class,new() public class Singleton<T> where T:class,new()

View File

@@ -1,11 +1,10 @@
using R3; using R3;
using System;
using UnityEngine; using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
public class SimpleR3Test : MonoBehaviour public class SimpleR3Test : MonoBehaviour
{ {
BindableReactiveProperty<float> value = new(0); public SerializableReactiveProperty<float> value = new(0);
public InputField inputField; public InputField inputField;
public Scrollbar scrollbar; public Scrollbar scrollbar;

View File

@@ -8,15 +8,15 @@ namespace R3
{ {
public static class UnityUIBindings public static class UnityUIBindings
{ {
public static IDisposable SubscribeToScrollbar(this Observable<float> source, Scrollbar scrollbar) public static IDisposable SubscribeToScrollbar(this ReactiveProperty<float> source, Scrollbar scrollbar)
{ {
return source.Subscribe(scrollbar, static (x, s) => s.value = x); return source.Subscribe(scrollbar, static (x, s) => s.value = x);
} }
public static IDisposable SubscribeToText(this Observable<float> source, InputField inputField) public static IDisposable SubscribeToText(this ReactiveProperty<float> source, InputField inputField)
{ {
return source.Subscribe(inputField, static (x, t) => t.text = x.ToString()); return source.Subscribe(inputField, static (x, t) => t.text = x.ToString());
} }
public static IDisposable BindToScrollbar(this BindableReactiveProperty<float> source, Scrollbar scrollbar) public static IDisposable BindToScrollbar(this ReactiveProperty<float> source, Scrollbar scrollbar)
{ {
var disposable = new CompositeDisposable(); var disposable = new CompositeDisposable();
@@ -28,7 +28,7 @@ namespace R3
return disposable; return disposable;
} }
public static IDisposable BindToInputField(this BindableReactiveProperty<float> source, InputField inputField) public static IDisposable BindToInputField(this ReactiveProperty<float> source, InputField inputField)
{ {
var disposable = new CompositeDisposable(); var disposable = new CompositeDisposable();

File diff suppressed because one or more lines are too long