品质色块修改
This commit is contained in:
13
Assets/Scripts/Fishing2/Helper/PathHelper.cs
Normal file
13
Assets/Scripts/Fishing2/Helper/PathHelper.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Assets/Scripts/Fishing2/Helper/PathHelper.cs.meta
Normal file
3
Assets/Scripts/Fishing2/Helper/PathHelper.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 774fd7a393874949863a694a79823e1c
|
||||
timeCreated: 1761145384
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/UI/Bag/BagPanel.Designer.cs
generated
2
Assets/Scripts/UI/Bag/BagPanel.Designer.cs
generated
@@ -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")]
|
||||
|
||||
@@ -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); }
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user