Merge branch 'YKing'

# Conflicts:
#	EintooAR/UserSettings/Layouts/default-6000.dwlt   resolved by main version
This commit is contained in:
SnowShow 2025-04-09 09:03:50 +08:00
commit 0679235d10
17 changed files with 224 additions and 50 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 46eb81630db32481d99dc4ef2179cb02
guid: 7435b49f78a441d48812d2a76bfb060a
folderAsset: yes
DefaultImporter:
externalObjects: {}

View File

@ -0,0 +1,50 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 33db15ab7111df346b5fe8279606ff1a, type: 3}
m_Name: PetResponseData
m_EditorClassIdentifier:
responseData:
code: 0
message:
data:
- id: 3
openid: oCD4_4zqcfgo-X66d7pdb7Mn0a3w
pic: https://arp3.arsnowslide.com/0cc96a251c44408b9c54cec443483d33.jpg?versionId=G00111959395337FFFFF981700E681A1
name: "\u7EFF\u65C5"
type: "\u732B,\u77ED\u6BDB\u732B,\u82F1\u56FD\u7CFB,\u84DD\u732B"
master: "\u5468123"
place: "\u5317\u4EAC\u5E02,\u4E1C\u57CE\u533A,\u4E1C\u534E\u95E8\u8857\u9053"
phone: 17625008824
- id: 13
openid: oCD4_4zqcfgo-X66d7pdb7Mn0a3w
pic: https://arp3.arsnowslide.com/d040da81741b4f2c8fa822e8602d2447.jpg?versionId=G0011195AC2F8E1EFFFF900F02341730
name: 123
type: "\u732B,\u77ED\u6BDB\u732B,\u82F1\u56FD\u7CFB,\u84DD\u732B"
master: 1234
place: "\u5317\u4EAC\u5E02,\u4E1C\u57CE\u533A,\u4E1C\u534E\u95E8\u8857\u9053"
phone: 17625008823
- id: 41
openid: oCD4_4zqcfgo-X66d7pdb7Mn0a3w
pic: https://arp3.arsnowslide.com/3bd541c8f8764d5d8b3b23d17cf30fca.jpg?versionId=G0011195D6D920D6FFFF90100409F154
name: 123123
type: "\u732B,\u957F\u6BDB\u732B,\u6CE2\u65AF\u7CFB,\u4F20\u7EDF\u6CE2\u65AF"
master: 123
place: "\u5317\u4EAC\u5E02,\u4E1C\u57CE\u533A,\u4E1C\u534E\u95E8\u8857\u9053"
phone: 17625008824
- id: 42
openid: oCD4_4zqcfgo-X66d7pdb7Mn0a3w
pic: https://arp3.arsnowslide.com/af2a0b228c6f44b1851964f71e3a2944.png?versionId=G0011195D6D9741AFFFF9014049D2C5D
name: 123
type: "\u732B,\u957F\u6BDB\u732B,\u6CE2\u65AF\u7CFB,\u4F20\u7EDF\u6CE2\u65AF"
master: 3123
place: "\u5317\u4EAC\u5E02,\u4E1C\u57CE\u533A,\u4E1C\u534E\u95E8\u8857\u9053"
phone: 17625008824

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 04f48c27d993680479d1ceea6b330a91
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -306,9 +306,9 @@ RectTransform:
- {fileID: 1851341283828806142}
m_Father: {fileID: 2427834482497326629}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 175, y: -150}
m_SizeDelta: {x: 300, y: 300}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &2026667239695996285
@ -457,9 +457,9 @@ RectTransform:
m_Children: []
m_Father: {fileID: 2427834482497326629}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 175, y: -325}
m_SizeDelta: {x: 132.48, y: 50}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &2949946672030507112
@ -619,7 +619,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0, g: 0, b: 0, a: 1}
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

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6e10d8de84bfaf648b8384725c901dd4
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -40,7 +40,8 @@ public partial class GameApp : Singleton<GameApp>
/// </summary>
private void StartGameLogic()
{
LoadGame().Forget();
//LoadGame().Forget();
GameModule.UI.ShowUI<UIPetInfoWindow>();
}
public async UniTask LoadGame()

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e4df0229621efba4c84ec39ef52bf6b9
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 51b0d8babe78a204388b55bb41e5d6e0
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,29 @@
using UnityEngine;
using System.Collections.Generic;
[CreateAssetMenu(fileName = "PetResponseData", menuName = "ScriptableObjects/PetResponseData")]
public class PetResponseScriptableObject : ScriptableObject
{
[System.Serializable]
public class PetData
{
public int id;
public string openid;
public string pic;
public string name;
public string type;
public string master;
public string place;
public string phone;
}
[System.Serializable]
public class ResponseData
{
public int code;
public string message;
public List<PetData> data;
}
public ResponseData responseData;
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 33db15ab7111df346b5fe8279606ff1a

View File

@ -2,13 +2,18 @@ using Cysharp.Threading.Tasks;
using UnityEngine;
using UnityEngine.UI;
using TEngine;
using System.Threading.Tasks;
using UnityEngine.Networking;
using Sirenix.Utilities.Editor.Expressions;
namespace GameLogic
{
[Window(UILayer.UI)]
class UIPetInfoWindow : UIWindow
{
private UIPetinfoWidget m_PetinfoWidget;
public PetResponseScriptableObject petData; // 宠物数据本地配置
private const string PET_DATA_PATH = "PetResponseData"; // 宠物数据本地配置路径
#region
private Button m_btnAddtionPet;
private GameObject m_goParent;
@ -32,7 +37,6 @@ namespace GameLogic
private async UniTaskVoid OnClickAddtionPetBtn() // 新增宠物
{
await UniTask.Yield();
CreatePetInfoPrefab();
}
private async UniTaskVoid OnClickCancleBtn() // 取消删除
{
@ -45,10 +49,64 @@ namespace GameLogic
}
#endregion
// 创建宠物信息
private void CreatePetInfoPrefab()
protected override void OnCreate()
{
m_PetinfoWidget = CreateWidgetByPath<UIPetinfoWidget>(m_goParent.transform, "UIPetinfoWidget");
base.OnCreate();
LoadPetData();
}
// 加载数据获取图片和图片名创建widget
private async void LoadPetData()
{
petData = GameModule.Resource.LoadAsset<PetResponseScriptableObject>(PET_DATA_PATH);
if (petData == null)
{
Debug.LogError("加载宠物ScriptableObject配置数据路径错误" + PET_DATA_PATH);
}
else
{
Debug.Log("宠物数据PetResponseScriptableObject加载完成.");
if (petData.responseData.data != null && petData.responseData.data.Count > 0)
{
foreach (var tmpDta in petData.responseData.data)
{
//Sprite sprite = await LoadSprite(tmpDta.pic);
Texture2D texture = await LoadTexture(tmpDta.pic);
Sprite sprite = Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), new Vector2(0.5f, 0.5f));
var Name = ImageUtility.GetImageNameFromUrl(tmpDta.pic);
if (sprite != null)
{
CreatePetInfoPrefab(sprite, Name);
}
else
{
Debug.LogError($"宠物图片加载失败: {tmpDta.name}");
}
}
}
else
{
Debug.Log("No pet data found in the response.");
}
}
}
// 加载纹理
private async Task<Texture2D> LoadTexture(string url)
{
var token = this.gameObject.GetCancellationTokenOnDestroy();
var trackImg = await ImageUtility.UnityWebDownloadTexture2D(url, token);
return trackImg;
}
// 创建宠物信息,设置widget信息
private void CreatePetInfoPrefab(Sprite sp, string petName)
{
CreateWidgetByPath<UIPetinfoWidget>(m_goParent.transform, "UIPetinfoWidget").SetPetBanData(sp, petName);
}
// 显示tip面板

View File

@ -33,11 +33,6 @@ MonoBehaviour:
referenceMode: 2
serializationDepthLimit: 64
assemblyNames:
- ARFoundationRemote.Meshing
- ARFoundationRemote.Runtime
- ARFoundationRemote.Runtime.BugReports
- ARFoundationRemote.RuntimeEditor
- ARFoundationRemote.Singleton
- Assembly-CSharp
- Assembly-CSharp-firstpass
- Boxophobic.AtmosphericHeightFog.Runtime

View File

@ -3,7 +3,6 @@
"com.code-philosophy.hybridclr": "https://gitee.com/focus-creative-games/hybridclr_unity.git",
"com.coffee.ui-effect": "5.6.1",
"com.fantasy.unity": "2024.2.24",
"com.kyrylokuzyk.arfoundationremote": "file:../Assets/Plugins/ARFoundationRemoteInstaller/com.kyrylokuzyk.arfoundationremote.tgz",
"com.tuyoogame.yooasset": "2.1.2",
"com.unity.2d.sprite": "1.0.0",
"com.unity.2d.tilemap": "1.0.0",

View File

@ -45,21 +45,6 @@
"com.unity.modules.animation": "1.0.0"
}
},
"com.kyrylokuzyk.arfoundationremote": {
"version": "file:../Assets/Plugins/ARFoundationRemoteInstaller/com.kyrylokuzyk.arfoundationremote.tgz",
"depth": 0,
"source": "local-tarball",
"dependencies": {
"com.unity.xr.arfoundation": "3.0.1",
"com.unity.xr.management": "3.0.4-preview.1",
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.modules.imageconversion": "1.0.0",
"com.unity.ugui": "1.0.0",
"com.unity.modules.particlesystem": "1.0.0",
"com.unity.modules.vr": "1.0.0",
"com.unity.modules.imgui": "1.0.0"
}
},
"com.tivadar.best.http": {
"version": "file:com.tivadar.best.http",
"depth": 0,
@ -683,7 +668,7 @@
},
"com.unity.modules.vr": {
"version": "1.0.0",
"depth": 1,
"depth": 2,
"source": "builtin",
"dependencies": {
"com.unity.modules.jsonserialize": "1.0.0",

View File

@ -44,6 +44,6 @@ MonoBehaviour:
m_RegistryInfoDraft:
m_Modified: 0
m_ErrorMessage:
m_UserModificationsInstanceId: -880
m_OriginalInstanceId: -884
m_UserModificationsInstanceId: -882
m_OriginalInstanceId: -886
m_LoadAssets: 0

View File

@ -798,7 +798,7 @@ PlayerSettings:
Standalone: ODIN_INSPECTOR;ODIN_INSPECTOR_3;ODIN_INSPECTOR_3_1;ODIN_VALIDATOR;ODIN_VALIDATOR_3_1;ENABLE_LOG;TextMeshPro;ES3_TMPRO;ES3_UGUI;ENVIRO_3;DOTWEEN;UNITY_POST_PROCESSING_STACK_V2;SLATE;NODECANVAS;ODIN_VALIDATOR_3_2;ODIN_VALIDATOR_3_3;ODIN_INSPECTOR_3_2;ODIN_INSPECTOR_3_3;ENABLE_HYBRIDCLR;ENABLE_VOXELBUSTERS_ESSENTIAL_KIT
VisionOS: TextMeshPro;ES3_TMPRO;ES3_UGUI;ENVIRO_3;DOTWEEN;UNITY_POST_PROCESSING_STACK_V2
WebGL: ENABLE_LOG;TextMeshPro;ES3_TMPRO;ES3_UGUI;ENVIRO_3;DOTWEEN;UNITY_POST_PROCESSING_STACK_V2;ENABLE_HYBRIDCLR;ENABLE_VOXELBUSTERS_ESSENTIAL_KIT
Windows Store Apps: ENABLE_LOG;ES3_TMPRO;ES3_UGUI;DOTWEEN;ENABLE_HYBRIDCLR
Windows Store Apps: ENABLE_LOG;ES3_TMPRO;ES3_UGUI;DOTWEEN;ENABLE_HYBRIDCLR;ENABLE_VOXELBUSTERS_ESSENTIAL_KIT
XboxOne: TextMeshPro;ES3_TMPRO;ES3_UGUI;ENVIRO_3;DOTWEEN;UNITY_POST_PROCESSING_STACK_V2
iPhone: ENABLE_LOG;TextMeshPro;UNITY_XR_ARKIT_LOADER_ENABLED;ES3_TMPRO;ES3_UGUI;DOTWEEN;ODIN_VALIDATOR;ODIN_VALIDATOR_3_1;ODIN_INSPECTOR;ODIN_INSPECTOR_3;ODIN_INSPECTOR_3_1;SLATE;NODECANVAS;ODIN_INSPECTOR_3_2;ODIN_INSPECTOR_3_3;ODIN_VALIDATOR_3_2;ODIN_VALIDATOR_3_3;ENABLE_HYBRIDCLR;ENABLE_VOXELBUSTERS_ESSENTIAL_KIT
tvOS: TextMeshPro;ES3_TMPRO;ES3_UGUI;ENVIRO_3;DOTWEEN;UNITY_POST_PROCESSING_STACK_V2