品质色块修改

This commit is contained in:
2025-10-23 22:59:04 +08:00
parent af7592331b
commit baa54a3f04
1617 changed files with 825 additions and 463 deletions

View File

@@ -0,0 +1,13 @@
using System.IO;
namespace NBF
{
public static class PathHelper
{
public static string GetFullPath(string path)
{
return Path.Combine("gfx", path);
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 774fd7a393874949863a694a79823e1c
timeCreated: 1761145384

View File

@@ -14,5 +14,12 @@ namespace NBF.Fishing2
var model = Resources.Load<GameObject>("Prefabs/Player/Human_Male");
return Object.Instantiate(model, parent);
}
public static GameObject CreatePrefab(string path)
{
//Assets/Resources/gfx/reels/syberia/spin_5002/spin_5002.prefab
var model = Resources.Load<GameObject>(PathHelper.GetFullPath(path));
return Object.Instantiate(model);
}
}
}

View File

@@ -15,7 +15,7 @@ namespace NBF
public override string UIResName => "BagPanel";
[AutoFind(Name = "back")]
public GImage back;
public GLabel back;
[AutoFind(Name = "BottomMenu")]
public BottomMenu BottomMenu;
[AutoFind(Name = "ItemList")]

View File

@@ -15,19 +15,21 @@ namespace NBF
public override string UIResName => "ItemDetailsPanel";
[AutoFind(Name = "back")]
public GImage back;
public GLabel back;
[AutoFind(Name = "BottomMenu")]
public BottomMenu BottomMenu;
[AutoFind(Name = "title")]
public GComponent title;
[AutoFind(Name = "modelBack")]
public GImage modelBack;
[AutoFind(Name = "Quality")]
public GImage Quality;
[AutoFind(Name = "Quality2")]
public GImage Quality2;
[AutoFind(Name = "Model")]
public ModelTexture Model;
[AutoFind(Name = "Content")]
public ItemDetailsContent Content;
[AutoFind(Name = "Quality")]
public GImage Quality;
public override string[] GetDependPackages(){ return new string[] {"Common"}; }
public static void Show(object param = null){ App.UI.OpenUI<ItemDetailsPanel>(param); }

View File

@@ -2,6 +2,7 @@
using UnityEngine;
using NBC;
using NBF.Fishing2;
namespace NBF
{
@@ -18,16 +19,15 @@ namespace NBF
protected override void OnShow()
{
ItemInfo = GetData() as ItemInfo;
// Model.SetModel();
// Instance = Object.Instantiate(prefab);
// Debug.LogError($"预制体:{prefab.name} 实例={Instance}");
// Model.SetModel(Instance);
Quality.SetQuality(ItemInfo.Config.Quality);
Content.Basic.SetInfo(ItemInfo);
Content.Basic.SetInfo(ItemInfo);
var model = PrefabsHelper.CreatePrefab(ItemInfo.Config.Model);
Model.SetModel(model);
// LoadModel(ItemInfo.Config.Model);
Game.Input.OnUICanceled += OnUICanceled;
}
@@ -49,6 +49,8 @@ namespace NBF
}
}
protected override void OnHide()
{
Game.Input.OnUICanceled -= OnUICanceled;

View File

@@ -87,18 +87,18 @@ namespace NBF
_panLimit = previewableAsset.pan;
_canPan = previewableAsset.canPan;
_canZoom = previewableAsset.canZoom;
// model.transform.localPosition = previewableAsset.position;
model.transform.localPosition = previewableAsset.position;
model.transform.localScale = previewableAsset.scale;
model.transform.localRotation = Quaternion.Euler(previewableAsset.rotation);
}
else
{
_canPan = false;
_canZoom = false;
_canPan = true;
_canZoom = true;
_zoomLimit = Vector3.zero;
_panLimit = Rect.zero;
// model.transform.localPosition = previewableAsset.position;
model.transform.localScale = Vector3.one;
model.transform.localPosition = new Vector3(0, 1.3f, 7);
model.transform.localScale = new Vector3(20, 20, 20);
model.transform.localRotation = Quaternion.Euler(Vector3.zero);
}
}