1
This commit is contained in:
@@ -6,24 +6,35 @@ using UnityEngine;
|
||||
/// <summary>
|
||||
/// 资源模块
|
||||
/// </summary>
|
||||
/// <typeparam name="Data">绑定的资源类型</typeparam>
|
||||
public abstract class ModuleAssets<Data> : MonoBehaviour {
|
||||
/// <summary> 必须要初始化 </summary>
|
||||
protected abstract void Awake();
|
||||
public class ModuleAssets<Data> {
|
||||
protected List<Data> datas = new List<Data>();
|
||||
/// <summary> 核心模块 </summary>
|
||||
protected virtual ModuleCore ModuleCore => ModuleCore.I;
|
||||
|
||||
/// <summary> 数据计数 </summary>
|
||||
public abstract int Count { get; }
|
||||
/// <summary> 更改事件 </summary>
|
||||
public virtual event Action OnChange;
|
||||
/// <summary> 数据列表 </summary>
|
||||
public abstract List<Data> Datas { get; }
|
||||
public virtual List<Data> Datas => datas;
|
||||
/// <summary> 数据计数 </summary>
|
||||
public virtual int Count => Datas.Count;
|
||||
/// <summary> 数据计数 </summary
|
||||
public virtual Data this[int index] => Datas[index];
|
||||
|
||||
/// <summary> 添加数据 </summary>
|
||||
public abstract void Add(Data data);
|
||||
public virtual void Add(Data data) { Datas.Add(data); OnChange?.Invoke(); }
|
||||
/// <summary> 添加数据 </summary>
|
||||
public virtual void AddRange(IList<Data> data) { Datas.AddRange(data); OnChange?.Invoke(); }
|
||||
/// <summary> 删除数据 </summary>
|
||||
public abstract void Remove(Data data);
|
||||
public virtual void Remove(Data data) { Datas.Remove(data); OnChange?.Invoke(); }
|
||||
|
||||
/// <summary> 保存数据 </summary>
|
||||
public virtual void Save() { throw new NotImplementedException(); }
|
||||
/// <summary> 加载数据 </summary>
|
||||
public virtual void Load() { throw new NotImplementedException(); }
|
||||
|
||||
/// <summary> 查询数据 </summary>
|
||||
public abstract Data Find(int index);
|
||||
public virtual Data Find(int index) { throw new NotImplementedException(); }
|
||||
public virtual Data Find(Guid guid) { throw new NotImplementedException(); }
|
||||
/// <summary> 循环列表 </summary>
|
||||
public abstract void ForEach(Action<Data> action);
|
||||
public virtual void ForEach(Action<Data> action) => Datas.ForEach(action);
|
||||
}
|
||||
|
||||
@@ -19,22 +19,69 @@ public abstract class ModuleCamera : MonoBehaviour {
|
||||
public abstract Vector3 EulerAngles { get; set; }
|
||||
/// <summary> 相机视野 </summary>
|
||||
public abstract float VisualField { get; set; }
|
||||
/// <summary> 当前相机 </summary>
|
||||
public abstract Camera ViewCamera { get; }
|
||||
|
||||
/// <summary> 渲染纹理 </summary>
|
||||
public abstract RenderTexture RenderTexture { get; }
|
||||
|
||||
public virtual RenderTexture RenderTexture { get; }
|
||||
/// <summary> 更新渲染纹理 </summary>
|
||||
public abstract void UpdateRenderTexture(int x, int y);
|
||||
/// <summary> 屏幕坐标转换视图坐标(0-1) </summary>
|
||||
public abstract Vector3 ScreenToViewPosition(Vector3 screenPosition);
|
||||
/// <summary> 屏幕坐标转换世界坐标 </summary>
|
||||
public abstract Vector3 ScreenToWorldPosition(Vector3 screenPosition);
|
||||
public virtual void UpdateRenderTexture(int x, int y) { }
|
||||
|
||||
#region 坐标转换
|
||||
/// <summary> 屏幕坐标转换视图坐标(0-1) </summary>
|
||||
public virtual Vector3 ScreenToViewPosition(Vector3 screenPosition) {
|
||||
return ViewCamera.ScreenToViewportPoint(screenPosition);
|
||||
}
|
||||
/// <summary> 屏幕坐标转换世界坐标 </summary>
|
||||
public virtual Vector3 ScreenToWorldPosition(Vector3 screenPosition) {
|
||||
return ViewCamera.ScreenToWorldPoint(screenPosition);
|
||||
}
|
||||
/// <summary> 视图坐标(0-1)转换屏幕坐标</summary>
|
||||
public virtual Vector3 ViewToScreenPosition(Vector3 screenPosition) {
|
||||
return ViewCamera.ViewportToScreenPoint(screenPosition);
|
||||
}
|
||||
/// <summary> 视图坐标(0-1)转换世界坐标 </summary>
|
||||
public virtual Vector3 ViewToWorldPosition(Vector3 screenPosition) {
|
||||
return ViewCamera.ViewportToWorldPoint(screenPosition);
|
||||
}
|
||||
/// <summary> 世界坐标转换屏幕坐标 </summary>
|
||||
public virtual Vector3 WorldToScreenPosition(Vector3 screenPosition) {
|
||||
return ViewCamera.WorldToScreenPoint(screenPosition);
|
||||
}
|
||||
/// <summary> 世界坐标转换视图坐标(0-1) </summary>
|
||||
public virtual Vector3 WorldToViewPosition(Vector3 screenPosition) {
|
||||
return ViewCamera.WorldToViewportPoint(screenPosition);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 射线检测
|
||||
private Ray ray;
|
||||
private RaycastHit hitInfo;
|
||||
/// <summary> 屏幕坐标获取世界对象 </summary>
|
||||
public abstract bool ScreenToWorldObject<T>(Vector3 screenPosition, out T value) where T : Object;
|
||||
public virtual bool ScreenToWorldObject<T>(Vector3 screenPosition, out T value) where T : Object {
|
||||
return ScreenToWorldObject(screenPosition, out value, DefaultLayerMask);
|
||||
}
|
||||
/// <summary> 屏幕坐标获取世界对象 </summary>
|
||||
public abstract bool ScreenToWorldObject<T>(Vector3 screenPosition, out T value, LayerMask planeLayerMask) where T : Object;
|
||||
public virtual bool ScreenToWorldObject<T>(Vector3 screenPosition, out T value, LayerMask planeLayerMask) where T : Object {
|
||||
ray = ViewCamera.ScreenPointToRay(screenPosition);
|
||||
Physics.Raycast(ray, out hitInfo, 200, planeLayerMask);
|
||||
value = hitInfo.transform?.GetComponent<T>();
|
||||
return value != null;
|
||||
}
|
||||
/// <summary> 屏幕坐标获取世界对象的父对象 </summary>
|
||||
public abstract bool ScreenToWorldObjectParent<T>(Vector3 screenPosition, out T value) where T : Object;
|
||||
public virtual bool ScreenToWorldObjectParent<T>(Vector3 screenPosition, out T value) where T : Object {
|
||||
return ScreenToWorldObjectParent(screenPosition, out value, DefaultLayerMask);
|
||||
}
|
||||
/// <summary> 屏幕坐标获取世界对象的父对象 </summary>
|
||||
public abstract bool ScreenToWorldObjectParent<T>(Vector3 screenPosition, out T value, LayerMask planeLayerMask) where T : Object;
|
||||
public virtual bool ScreenToWorldObjectParent<T>(Vector3 screenPosition, out T value, LayerMask planeLayerMask) where T : Object {
|
||||
ray = ViewCamera.ScreenPointToRay(screenPosition);
|
||||
Physics.Raycast(ray, out hitInfo, 200, planeLayerMask);
|
||||
value = hitInfo.transform?.GetComponentInParent<T>();
|
||||
return value != null;
|
||||
}
|
||||
#endregion
|
||||
|
||||
protected virtual void Update() {
|
||||
Debug.DrawRay(ray.origin, ray.direction * 10, Color.yellow);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,4 +7,11 @@ using UnityEngine;
|
||||
/// </summary>
|
||||
public class ModuleCore : Module<ModuleCore> {
|
||||
|
||||
#region 页面模块
|
||||
/// <summary> 不会被销毁的全局唯一页面模块 (UIDocument) </summary>
|
||||
public ModuleUIPage GlobalPage;
|
||||
/// <summary> 当前的主要页面模块 (UIDocument) </summary>
|
||||
public ModuleUIPage CurrentPage;
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2040d20cfab7df54f98017095d713005
|
||||
guid: ce17d4a855942e747b3a1a85af3fbf7b
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// 数据处理器模块
|
||||
/// </summary>
|
||||
public class ModuleHandle<T> {
|
||||
/// <summary> 数据 </summary>
|
||||
protected T value;
|
||||
/// <summary> 核心模块 </summary>
|
||||
protected virtual ModuleCore ModuleCore => ModuleCore.I;
|
||||
|
||||
/// <summary> 当前数据 </summary>
|
||||
public virtual T Current => value;
|
||||
/// <summary> 当前数据是否有效 </summary>
|
||||
public virtual bool IsValid => Current != null;
|
||||
|
||||
/// <summary> 改变当前数据 Event </summary>
|
||||
public virtual event Action<T> OnChange;
|
||||
/// <summary> 改变当前数据 </summary>
|
||||
public virtual void Change() => OnChange?.Invoke(value);
|
||||
/// <summary> 改变当前数据 </summary>
|
||||
public virtual void Change(T value) {this.value = value; OnChange?.Invoke(value); }
|
||||
}
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d6cbde8dad4ff3f44bd5cc80c96fc3b9
|
||||
guid: 73ab810e12f76f449ba3e6351467ebcb
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
@@ -7,14 +7,14 @@ using UnityEngine;
|
||||
/// </summary>
|
||||
public abstract class ModuleSingle<Data> : MonoBehaviour {
|
||||
/// <summary> 必须要初始化 </summary>
|
||||
protected abstract void Awake();
|
||||
protected virtual void Awake() { }
|
||||
/// <summary> 核心模块 </summary>
|
||||
protected virtual ModuleCore ModuleCore => ModuleCore.I;
|
||||
|
||||
/// <summary> 打开 </summary>
|
||||
public abstract void Open(Data data);
|
||||
public virtual void Open(Data data) { }
|
||||
/// <summary> 完成 </summary>
|
||||
public abstract void Complete();
|
||||
public virtual void Complete() { }
|
||||
/// <summary> 关闭 </summary>
|
||||
public abstract void Close();
|
||||
public virtual void Close() { }
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class UIGlobalPage : ModuleUIPage {
|
||||
protected override void Awake() => ModuleCore.GlobalPage = this;
|
||||
|
||||
private void Start() {
|
||||
string url = "https://neiyihuizhouilabtest.zgfzjy.cn/api/client/color/categroies";
|
||||
DataRequestGet request = new DataRequestGet(url);
|
||||
request.OnCallback = (obj) => { Debug.Log(obj); };
|
||||
WebRequest.Send(request);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a8717da59b9a2e04ca682f70aaabee0e
|
||||
guid: 6f0700aede140c44fb927acc112b9998
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
@@ -20,11 +20,13 @@ public abstract class ModuleUIPanel : MonoBehaviour {
|
||||
/// <summary>
|
||||
/// UI项
|
||||
/// </summary>
|
||||
public abstract class UIItem<Data, T> where T : UIItem<Data, T> {
|
||||
public abstract class UIItem<Data> {
|
||||
/// <summary> 选择事件 </summary>
|
||||
public static event Action<Data> OnSelect;
|
||||
/// <summary> 触发事件 </summary>
|
||||
public static void Select(Data data) => OnSelect?.Invoke(data);
|
||||
/// <summary> 核心模块 </summary>
|
||||
protected virtual ModuleCore ModuleCore => ModuleCore.I;
|
||||
/// <summary> 绑定的数据 </summary>
|
||||
public readonly Data value;
|
||||
/// <summary> 绑定的元素 </summary>
|
||||
@@ -33,12 +35,12 @@ public abstract class UIItem<Data, T> where T : UIItem<Data, T> {
|
||||
public UIItem(Data value, VisualElement element) {
|
||||
this.value = value;
|
||||
this.element = element;
|
||||
OnSelect += UnitUIPanelItem_OnSelect;
|
||||
OnSelect += UIItem_OnSelect;
|
||||
}
|
||||
/// <summary> 触发选择事件 </summary>
|
||||
public virtual void Select() => OnSelect?.Invoke(value);
|
||||
/// <summary> 侦听选择事件 </summary>
|
||||
public virtual void UnitUIPanelItem_OnSelect(Data obj) {
|
||||
public virtual void UIItem_OnSelect(Data obj) {
|
||||
if (value.Equals(obj)) { SelectState(); }
|
||||
else { DefaultState(); }
|
||||
}
|
||||
@@ -47,5 +49,5 @@ public abstract class UIItem<Data, T> where T : UIItem<Data, T> {
|
||||
/// <summary> 选中状态 </summary>
|
||||
public virtual void SelectState() { }
|
||||
/// <summary> 释放 </summary>
|
||||
public virtual void Release() => OnSelect -= UnitUIPanelItem_OnSelect;
|
||||
}
|
||||
public virtual void Release() => OnSelect -= UIItem_OnSelect;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 084186be84d61d44da10ee78c0cf0b10
|
||||
guid: 2c6f02c8edd5f1241b53b0c7e538e84a
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
@@ -3,7 +3,7 @@ using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// 可视化内容生成模块
|
||||
/// 生成可视化内容模块
|
||||
/// </summary>
|
||||
public abstract class ModuleVisual<Data> : MonoBehaviour {
|
||||
/// <summary> 必须要初始化 </summary>
|
||||
@@ -11,7 +11,7 @@ public abstract class ModuleVisual<Data> : MonoBehaviour {
|
||||
/// <summary> 核心模块 </summary>
|
||||
protected virtual ModuleCore ModuleCore => ModuleCore.I;
|
||||
|
||||
/// <summary> 更新可视化 </summary>
|
||||
/// <summary> 更新可视化内容 </summary>
|
||||
public abstract void UpdateVisual(Data data);
|
||||
/// <summary> 释放可视化内容 </summary>
|
||||
public abstract void ReleaseVisual(Data data);
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// 鼠标输入参数
|
||||
/// </summary>
|
||||
public class DataMouseInput {
|
||||
/// <summary> 鼠标输入参数 </summary>
|
||||
public DataMouseInput() { }
|
||||
/// <summary> 鼠标滚动量 </summary>
|
||||
public float ScrollWheel;
|
||||
/// <summary> 视图坐标 </summary>
|
||||
public Vector3 ViewPosition;
|
||||
/// <summary> 世界坐标 </summary>
|
||||
public Vector3 WorldPosition;
|
||||
/// <summary> 屏幕坐标 </summary>
|
||||
public Vector3 ScreenPosition;
|
||||
}
|
||||
@@ -6,11 +6,13 @@ using UnityEngine;
|
||||
/// 预制件模块
|
||||
/// </summary>
|
||||
public abstract class ModulePrefab<Data> : MonoBehaviour {
|
||||
/// <summary> 关联的数据 </summary>
|
||||
protected Data value;
|
||||
/// <summary> 核心模块 </summary>
|
||||
protected virtual ModuleCore ModuleCore => ModuleCore.I;
|
||||
|
||||
/// <summary> 关联的数据 </summary>
|
||||
public abstract Data Value { get; }
|
||||
public virtual Data Value => value;
|
||||
/// <summary> 更新可视化内容 </summary>
|
||||
public abstract void UpdateVisual(Data data);
|
||||
public virtual void UpdateVisual(Data value) => this.value = value;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,177 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Networking;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
/// <summary>
|
||||
/// 网络请求工具
|
||||
/// </summary>
|
||||
public static class WebRequest {
|
||||
public static TaskAwaiter<object> GetAwaiter(this UnityWebRequestAsyncOperation op) {
|
||||
var tcs = new TaskCompletionSource<object>();
|
||||
op.completed += (obj) => { tcs.SetResult(null); };
|
||||
return tcs.Task.GetAwaiter();
|
||||
}
|
||||
/// <summary> 发送请求 </summary>
|
||||
public static void Send(DataRequest request) {
|
||||
if (request.RequestType == WebRequestType.GET) { Get(request); }
|
||||
if (request.RequestType == WebRequestType.POSTFORM) { PostForm(request); }
|
||||
if (request.RequestType == WebRequestType.POSTJSON) { PostJson(request); }
|
||||
if (request.RequestType == WebRequestType.Texture) { Texture(request); }
|
||||
}
|
||||
public static async void Get(DataRequest request) {
|
||||
string url = request.Url;
|
||||
using UnityWebRequest web = UnityWebRequest.Get(url);
|
||||
await web.SendWebRequest();
|
||||
bool isDone = web.isDone && web.result == UnityWebRequest.Result.Success;
|
||||
request.RequestResultHandle(isDone, web.downloadHandler);
|
||||
}
|
||||
public static async void PostForm(DataRequest request) {
|
||||
string url = request.Url;
|
||||
WWWForm form = request.Form;
|
||||
using UnityWebRequest web = UnityWebRequest.Post(url, form);
|
||||
await web.SendWebRequest();
|
||||
bool isDone = web.isDone && web.result == UnityWebRequest.Result.Success;
|
||||
request.RequestResultHandle(isDone, web.downloadHandler);
|
||||
}
|
||||
public static async void PostJson(DataRequest request) {
|
||||
string url = request.Url;
|
||||
string json = request.Json;
|
||||
byte[] postBytes = System.Text.Encoding.Default.GetBytes(json);
|
||||
#if UNITY_2022
|
||||
using UnityWebRequest web = UnityWebRequest.PostWwwForm(url, "POST");
|
||||
#else
|
||||
using UnityWebRequest web = UnityWebRequest.Post(url, "POST");
|
||||
#endif
|
||||
web.uploadHandler.Dispose();
|
||||
web.uploadHandler = new UploadHandlerRaw(postBytes);
|
||||
web.SetRequestHeader("Content-Type", "application/json");
|
||||
await web.SendWebRequest();
|
||||
bool isDone = web.isDone && web.result == UnityWebRequest.Result.Success;
|
||||
request.RequestResultHandle(isDone, web.downloadHandler);
|
||||
|
||||
}
|
||||
public static async void Texture(DataRequest request) {
|
||||
string url = request.Url;
|
||||
using UnityWebRequest web = UnityWebRequestTexture.GetTexture(url);
|
||||
await web.SendWebRequest();
|
||||
bool isDone = web.isDone && web.result == UnityWebRequest.Result.Success;
|
||||
request.RequestResultHandle(isDone, web.downloadHandler);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Web请求类型
|
||||
/// </summary>
|
||||
public enum WebRequestType {
|
||||
/// <summary> GET </summary>
|
||||
GET = 0,
|
||||
/// <summary> POST 表单 </summary>
|
||||
POSTFORM = 1,
|
||||
/// <summary> POST Json </summary>
|
||||
POSTJSON = 2,
|
||||
/// <summary> GET 获取图片 </summary>
|
||||
Texture = 3
|
||||
}
|
||||
/// <summary>
|
||||
/// 请求数据
|
||||
/// </summary>
|
||||
public abstract class DataRequest {
|
||||
/// <summary> Web请求地址 </summary>
|
||||
public abstract string Url { get; }
|
||||
/// <summary> Web请求类型 </summary>
|
||||
public abstract WebRequestType RequestType { get; }
|
||||
/// <summary> 提交json数据 </summary>
|
||||
public virtual string Json { get; }
|
||||
/// <summary> 提交Form表单数据 </summary>
|
||||
public virtual WWWForm Form { get; }
|
||||
|
||||
/// <summary> Web请求结果处理 </summary>
|
||||
public abstract void RequestResultHandle(bool isDone, DownloadHandler downloadHandler);
|
||||
}
|
||||
/// <summary>
|
||||
/// Get请求数据
|
||||
/// </summary>
|
||||
public class DataRequestGet : DataRequest {
|
||||
public readonly string url;
|
||||
|
||||
public Action<string> OnError;
|
||||
public Action<string> OnCallback;
|
||||
|
||||
public override string Url => url;
|
||||
public override WebRequestType RequestType => WebRequestType.GET;
|
||||
|
||||
/// <summary> Web Get请求数据 </summary>
|
||||
public DataRequestGet(string url, Action<string> OnCallback = null) {
|
||||
this.url = url;
|
||||
this.OnCallback = OnCallback;
|
||||
}
|
||||
|
||||
public override void RequestResultHandle(bool isDone, DownloadHandler downloadHandler) {
|
||||
if (!isDone) { OnError?.Invoke(downloadHandler.text); return; }
|
||||
OnCallback?.Invoke(downloadHandler.text);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Post请求数据
|
||||
/// </summary>
|
||||
public class DataRequestPost : DataRequest {
|
||||
public readonly string url;
|
||||
public readonly string json;
|
||||
public readonly WWWForm form;
|
||||
public readonly WebRequestType type;
|
||||
|
||||
public Action<string> OnError;
|
||||
public Action<string> OnCallback;
|
||||
|
||||
public override string Url => url;
|
||||
public override WebRequestType RequestType => type;
|
||||
public override string Json => json;
|
||||
public override WWWForm Form => form;
|
||||
|
||||
/// <summary> Web Post请求 提交json数据 </summary>
|
||||
public DataRequestPost(string url, string json, Action<string> OnCallback = null) {
|
||||
this.url = url;
|
||||
this.json = json;
|
||||
this.OnCallback = OnCallback;
|
||||
type = WebRequestType.POSTJSON;
|
||||
}
|
||||
/// <summary> Web Post请求 提交WWWForm数据 </summary>
|
||||
public DataRequestPost(string url, WWWForm form, Action<string> OnCallback = null) {
|
||||
this.url = url;
|
||||
this.form = form;
|
||||
this.OnCallback = OnCallback;
|
||||
type = WebRequestType.POSTFORM;
|
||||
}
|
||||
|
||||
public override void RequestResultHandle(bool isDone, DownloadHandler downloadHandler) {
|
||||
if (!isDone) { OnError?.Invoke(downloadHandler.text); return; }
|
||||
OnCallback?.Invoke(downloadHandler.text);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Get下载 Texture
|
||||
/// </summary>
|
||||
public class DataRequestTexture : DataRequest {
|
||||
public readonly string url;
|
||||
|
||||
public Action<string> OnError;
|
||||
public Action<Texture2D> OnCallback;
|
||||
|
||||
public override string Url => url;
|
||||
public override WebRequestType RequestType => WebRequestType.Texture;
|
||||
|
||||
/// <summary> Web Get请求 Texture </summary>
|
||||
public DataRequestTexture(string url, Action<Texture2D> OnCallback = null) {
|
||||
this.url = url;
|
||||
this.OnCallback = OnCallback;
|
||||
}
|
||||
|
||||
public override void RequestResultHandle(bool isDone, DownloadHandler downloadHandler) {
|
||||
if (!isDone) { OnError?.Invoke(downloadHandler.text); return; }
|
||||
DownloadHandlerTexture dht = downloadHandler as DownloadHandlerTexture;
|
||||
OnCallback?.Invoke(dht.texture);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fdd231128f69bd54a915b218d734fef6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,19 +0,0 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public abstract class UnitMouseInput {
|
||||
/// <summary> 核心模块 </summary>
|
||||
protected virtual ModuleCore ModuleCore => ModuleCore.I;
|
||||
|
||||
/// <summary> 按下鼠标 </summary>
|
||||
public virtual void MouseDown(DataMouseInput data) { }
|
||||
/// <summary> 拖拽鼠标 </summary>
|
||||
public virtual void MouseDrag(DataMouseInput data) { }
|
||||
/// <summary> 移动鼠标 </summary>
|
||||
public virtual void MouseMove(DataMouseInput data) { }
|
||||
/// <summary> 释放鼠标 </summary>
|
||||
public virtual void MouseRelease(DataMouseInput data) { }
|
||||
/// <summary> 鼠标滚轮 </summary>
|
||||
public virtual void MouseScroll(DataMouseInput data) { }
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e6ffff57450000c409c511daef71ed5a
|
||||
guid: c3d770cd16ec08b4f92cd1ed21c9a532
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
@@ -19,8 +19,8 @@ MonoBehaviour:
|
||||
m_RendererDataList:
|
||||
- {fileID: 11400000, guid: 3f474788b7568e24d96b9949b0ba2221, type: 2}
|
||||
m_DefaultRendererIndex: 0
|
||||
m_RequireDepthTexture: 0
|
||||
m_RequireOpaqueTexture: 0
|
||||
m_RequireDepthTexture: 1
|
||||
m_RequireOpaqueTexture: 1
|
||||
m_OpaqueDownsampling: 1
|
||||
m_SupportsTerrainHoles: 1
|
||||
m_SupportsHDR: 1
|
||||
|
||||
@@ -122,6 +122,39 @@ NavMeshSettings:
|
||||
debug:
|
||||
m_Flags: 0
|
||||
m_NavMeshData: {fileID: 0}
|
||||
--- !u!1 &701611850
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 701611851}
|
||||
m_Layer: 0
|
||||
m_Name: "----\u573A\u666F\u8BBE\u7F6E----"
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &701611851
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 701611850}
|
||||
serializedVersion: 2
|
||||
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:
|
||||
- {fileID: 963194228}
|
||||
- {fileID: 705507995}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &705507993
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -132,6 +165,7 @@ GameObject:
|
||||
m_Component:
|
||||
- component: {fileID: 705507995}
|
||||
- component: {fileID: 705507994}
|
||||
- component: {fileID: 705507996}
|
||||
m_Layer: 0
|
||||
m_Name: Directional Light
|
||||
m_TagString: Untagged
|
||||
@@ -214,8 +248,31 @@ Transform:
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_Father: {fileID: 701611851}
|
||||
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
|
||||
--- !u!114 &705507996
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 705507993}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 474bcb49853aa07438625e644c072ee6, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Version: 3
|
||||
m_UsePipelineSettings: 1
|
||||
m_AdditionalLightsShadowResolutionTier: 2
|
||||
m_LightLayerMask: 1
|
||||
m_RenderingLayers: 1
|
||||
m_CustomShadowLayers: 0
|
||||
m_ShadowLayerMask: 1
|
||||
m_ShadowRenderingLayers: 1
|
||||
m_LightCookieSize: {x: 1, y: 1}
|
||||
m_LightCookieOffset: {x: 0, y: 0}
|
||||
m_SoftShadowQuality: 0
|
||||
--- !u!1 &963194225
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -227,6 +284,7 @@ GameObject:
|
||||
- component: {fileID: 963194228}
|
||||
- component: {fileID: 963194227}
|
||||
- component: {fileID: 963194226}
|
||||
- component: {fileID: 963194229}
|
||||
m_Layer: 0
|
||||
m_Name: Main Camera
|
||||
m_TagString: MainCamera
|
||||
@@ -301,16 +359,171 @@ Transform:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 963194225}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 1, z: -10}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 701611851}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &963194229
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 963194225}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_RenderShadows: 1
|
||||
m_RequiresDepthTextureOption: 2
|
||||
m_RequiresOpaqueTextureOption: 2
|
||||
m_CameraType: 0
|
||||
m_Cameras: []
|
||||
m_RendererIndex: -1
|
||||
m_VolumeLayerMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 1
|
||||
m_VolumeTrigger: {fileID: 0}
|
||||
m_VolumeFrameworkUpdateModeOption: 2
|
||||
m_RenderPostProcessing: 0
|
||||
m_Antialiasing: 0
|
||||
m_AntialiasingQuality: 2
|
||||
m_StopNaN: 0
|
||||
m_Dithering: 0
|
||||
m_ClearDepth: 1
|
||||
m_AllowXRRendering: 1
|
||||
m_AllowHDROutput: 1
|
||||
m_UseScreenCoordOverride: 0
|
||||
m_ScreenSizeOverride: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_RequiresDepthTexture: 0
|
||||
m_RequiresColorTexture: 0
|
||||
m_Version: 2
|
||||
m_TaaSettings:
|
||||
m_Quality: 3
|
||||
m_FrameInfluence: 0.1
|
||||
m_JitterScale: 1
|
||||
m_MipBias: 0
|
||||
m_VarianceClampScale: 0.9
|
||||
m_ContrastAdaptiveSharpening: 0
|
||||
--- !u!1 &1087494256
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1087494258}
|
||||
- component: {fileID: 1087494257}
|
||||
m_Layer: 0
|
||||
m_Name: "----\u5F53\u524D\u754C\u9762----"
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &1087494257
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1087494256}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 19102, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_PanelSettings: {fileID: 11400000, guid: 4caef6f0e9981084a9e0cbfd447fac06, type: 2}
|
||||
m_ParentUI: {fileID: 0}
|
||||
sourceAsset: {fileID: 0}
|
||||
m_SortingOrder: 0
|
||||
--- !u!4 &1087494258
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1087494256}
|
||||
serializedVersion: 2
|
||||
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}
|
||||
--- !u!1 &1409533256
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1409533258}
|
||||
- component: {fileID: 1409533257}
|
||||
- component: {fileID: 1409533259}
|
||||
m_Layer: 0
|
||||
m_Name: "----\u5168\u5C40\u9875\u9762----"
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &1409533257
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1409533256}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 19102, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_PanelSettings: {fileID: 11400000, guid: 4caef6f0e9981084a9e0cbfd447fac06, type: 2}
|
||||
m_ParentUI: {fileID: 0}
|
||||
sourceAsset: {fileID: 0}
|
||||
m_SortingOrder: 0
|
||||
--- !u!4 &1409533258
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1409533256}
|
||||
serializedVersion: 2
|
||||
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}
|
||||
--- !u!114 &1409533259
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1409533256}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 6f0700aede140c44fb927acc112b9998, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
document: {fileID: 1409533257}
|
||||
--- !u!1660057539 &9223372036854775807
|
||||
SceneRoots:
|
||||
m_ObjectHideFlags: 0
|
||||
m_Roots:
|
||||
- {fileID: 963194228}
|
||||
- {fileID: 705507995}
|
||||
- {fileID: 701611851}
|
||||
- {fileID: 1087494258}
|
||||
- {fileID: 1409533258}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 66a395f3ea697364e99e2803f494bcf0
|
||||
guid: 4e1b362a28ce4c04babda53ffbecf64e
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
@@ -0,0 +1 @@
|
||||
VisualElement {}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e586d71f691bf1a4bab490af1c2cfe7f
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0}
|
||||
disableValidation: 0
|
||||
@@ -0,0 +1,3 @@
|
||||
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../../UIElementsSchema/UIElements.xsd" editor-extension-mode="False">
|
||||
<Style src="project://database/Assets/UI%20Toolkit/GlobalPage/GlobalPage.uss?fileID=7433441132597879392&guid=e586d71f691bf1a4bab490af1c2cfe7f&type=3#GlobalPage" />
|
||||
</ui:UXML>
|
||||
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 43fe5b5fa3469a245854d8ca70e39edf
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
|
||||
Reference in New Issue
Block a user