1
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
%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: 8c4f2e6a9b1d4c7e5f3a8b2d6e9c1f4a, type: 3}
|
||||
m_Name: BiaoQingConfig
|
||||
m_EditorClassIdentifier:
|
||||
list_BiaoQingSpine:
|
||||
- skeletonDataAsset: {fileID: 11400000, guid: 283c274e61f95194397402073efe8b1c,
|
||||
type: 2}
|
||||
animationNames:
|
||||
- bbb
|
||||
- bf
|
||||
- dno
|
||||
- gxfc
|
||||
- hd
|
||||
- mbdl
|
||||
- pc
|
||||
- pf
|
||||
- rjbzd
|
||||
list_BiaoQingZi:
|
||||
- "大家好,很高兴一起捕鱼!"
|
||||
- "哇!大鱼来啦!"
|
||||
- "发财的节奏啊!"
|
||||
- "爽!这波赚大了"
|
||||
- "加油,好运马上来"
|
||||
- "冲呀,胜利在望!"
|
||||
- "一起围捕,别让它跑了"
|
||||
- "运气什么时候来啊?"
|
||||
- "今天这是怎么了,全空!"
|
||||
- "是不是有吸鱼大法,教教我!"
|
||||
- "就这?抢不过我回家种地去吧!"
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3e7b9d1f5a8c2e6b4d9f7a3c5e1b8d6f
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,20 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// 表情包配置资产(ScriptableObject):一份配置多场景共用
|
||||
/// (各游戏场景 GameMainPanel 的 biaoQingConfig 字段拖入同一份 .asset)。
|
||||
/// Assets 右键 → Create → MyGame → 表情包配置 生成 .asset。
|
||||
/// GameMainPanel_FishBase 读取优先级:biaoQingConfig 已拖 → 用资产;未拖 → 回退面板上的 list_BiaoQingSpine/list_BiaoQingZi 旧字段。
|
||||
/// ⚠ 网络同步用 (spine 列表下标 + 动画名) 定位 spine 表情,所有客户端必须引用同一份资产,
|
||||
/// 配好后不要调整 list_BiaoQingSpine 的元素顺序(只允许在末尾追加)。
|
||||
/// </summary>
|
||||
[CreateAssetMenu(fileName = "BiaoQingConfig", menuName = "MyGame/表情包配置", order = 0)]
|
||||
public class BiaoQingConfig : ScriptableObject
|
||||
{
|
||||
[Tooltip("spine 表情配置:每个元素=一个spine文件+动画名列表,按动画名逐个克隆成表情项(下标参与网络同步,配好后不要调整顺序)")]
|
||||
public List<BiaoQingSpineData> list_BiaoQingSpine = new List<BiaoQingSpineData>();
|
||||
|
||||
[Tooltip("文字表情内容列表,一条文字克隆一个表情项")]
|
||||
public List<string> list_BiaoQingZi = new List<string>();
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8c4f2e6a9b1d4c7e5f3a8b2d6e9c1f4a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -155,15 +155,17 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
|
||||
public Button btn_ChangeRoom;
|
||||
|
||||
[Header("表情包")]
|
||||
[Tooltip("表情包配置资产(一份配置多场景共用;未拖时回退下方面板旧字段)")]
|
||||
public BiaoQingConfig biaoQingConfig;
|
||||
public Button btn_BiaoQing; // 打开/关闭表情面板
|
||||
public GameObject obj_BiaoQingPanel; // 表情面板(开/关)
|
||||
public GameObject obj_BiaoQingZiItemPrefab; // 文字表情项预制体(child0=TextMeshProUGUI)
|
||||
public GameObject obj_BiaoQingSpineItemPrefab; // spine表情项预制体(child0=SkeletonGraphic)
|
||||
public GameObject obj_BiaoQingSpineItemParent; // spine表情项生成的父节点
|
||||
public GameObject obj_BiaoQingZiItemParent; // 文字表情项生成的父节点
|
||||
[Tooltip("spine 表情配置:每个元素=一个spine文件+动画名列表,按动画名逐个克隆成表情项")]
|
||||
[Tooltip("(回退用)spine 表情配置:优先读 biaoQingConfig 资产,未拖资产时才用这里")]
|
||||
public List<BiaoQingSpineData> list_BiaoQingSpine = new List<BiaoQingSpineData>();
|
||||
[Tooltip("文字表情内容列表,一条文字克隆一个表情项")]
|
||||
[Tooltip("(回退用)文字表情内容列表:优先读 biaoQingConfig 资产,未拖资产时才用这里")]
|
||||
public List<string> list_BiaoQingZi = new List<string>();
|
||||
|
||||
|
||||
@@ -600,7 +602,11 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
|
||||
bool open = !obj_PropPanel.activeSelf;
|
||||
obj_PropPanel.SetActive(open);
|
||||
if (open)
|
||||
{
|
||||
BuildPropList();
|
||||
// ⭐ 数量是动态数据:每次打开面板都刷新一级角标(构建有一次性守卫,刷新无守卫)
|
||||
RefreshPropFirstLayerCounts();
|
||||
}
|
||||
else if (tmp_PropTwoPanel != null)
|
||||
tmp_PropTwoPanel.SetActive(false);
|
||||
});
|
||||
@@ -1274,6 +1280,14 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
|
||||
|
||||
#region 表情包(BiaoQingModule:列表生成 + 发送 + 广播接收)
|
||||
|
||||
/// <summary>spine 表情列表:优先读 biaoQingConfig 配置资产(多场景共用一份),未拖资产时回退面板字段</summary>
|
||||
private List<BiaoQingSpineData> BiaoQingSpineList =>
|
||||
biaoQingConfig != null ? biaoQingConfig.list_BiaoQingSpine : list_BiaoQingSpine;
|
||||
|
||||
/// <summary>文字表情列表:优先读 biaoQingConfig 配置资产(多场景共用一份),未拖资产时回退面板字段</summary>
|
||||
private List<string> BiaoQingZiList =>
|
||||
biaoQingConfig != null ? biaoQingConfig.list_BiaoQingZi : list_BiaoQingZi;
|
||||
|
||||
/// <summary>表情列表是否已生成(首次打开面板时生成一次)</summary>
|
||||
private bool _biaoQingListBuilt = false;
|
||||
|
||||
@@ -1293,9 +1307,9 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
|
||||
|
||||
/// <summary>
|
||||
/// 生成表情列表(只生成一次),两种形式分开处理:
|
||||
/// ① spine 表情:遍历 list_BiaoQingSpine,每个配置里的每个动画名克隆一个 spine 项
|
||||
/// ① spine 表情:遍历 BiaoQingSpineList(优先 biaoQingConfig 资产),每个配置里的每个动画名克隆一个 spine 项
|
||||
/// (child0=SkeletonGraphic → 换骨骼资源 + 循环播放该动画做列表预览);
|
||||
/// ② 文字表情:list_BiaoQingZi 每条文字克隆一个文字项(child0=TextMeshProUGUI → 设置文字)。
|
||||
/// ② 文字表情:BiaoQingZiList 每条文字克隆一个文字项(child0=TextMeshProUGUI → 设置文字)。
|
||||
/// </summary>
|
||||
private void BuildBiaoQingList()
|
||||
{
|
||||
@@ -1305,9 +1319,9 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
|
||||
// ---- ① spine 表情:一个动画名 = 一项 ----
|
||||
if (obj_BiaoQingSpineItemPrefab != null && obj_BiaoQingSpineItemParent != null)
|
||||
{
|
||||
for (int i = 0; i < list_BiaoQingSpine.Count; i++)
|
||||
for (int i = 0; i < BiaoQingSpineList.Count; i++)
|
||||
{
|
||||
var cfg = list_BiaoQingSpine[i];
|
||||
var cfg = BiaoQingSpineList[i];
|
||||
if (cfg == null || cfg.skeletonDataAsset == null) continue;
|
||||
|
||||
foreach (var animName in cfg.animationNames)
|
||||
@@ -1338,7 +1352,7 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
|
||||
// ---- ② 文字表情:一条文字 = 一项 ----
|
||||
if (obj_BiaoQingZiItemPrefab != null && obj_BiaoQingZiItemParent != null)
|
||||
{
|
||||
foreach (var text in list_BiaoQingZi)
|
||||
foreach (var text in BiaoQingZiList)
|
||||
{
|
||||
if (string.IsNullOrEmpty(text)) continue;
|
||||
|
||||
@@ -1404,9 +1418,9 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
|
||||
|
||||
if (type == BiaoQingType.spine)
|
||||
{
|
||||
// spineIndex = list_BiaoQingSpine 配置下标 → 取骨骼资源交给座位显示
|
||||
var cfg = (spineIndex >= 0 && spineIndex < list_BiaoQingSpine.Count)
|
||||
? list_BiaoQingSpine[spineIndex]
|
||||
// spineIndex = 表情配置列表下标(biaoQingConfig 资产)→ 取骨骼资源交给座位显示
|
||||
var cfg = (spineIndex >= 0 && spineIndex < BiaoQingSpineList.Count)
|
||||
? BiaoQingSpineList[spineIndex]
|
||||
: null;
|
||||
if (cfg == null || cfg.skeletonDataAsset == null) return;
|
||||
sit.ShowBiaoQingSpine(cfg.skeletonDataAsset, content);
|
||||
@@ -1491,6 +1505,9 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
|
||||
|
||||
private bool _propListBuilt;
|
||||
|
||||
/// <summary>已构建的一级道具项映射(cfg → 克隆项),供数量角标刷新用</summary>
|
||||
private readonly List<KeyValuePair<PropItemData, GameObject>> _propFirstLayerItems = new List<KeyValuePair<PropItemData, GameObject>>();
|
||||
|
||||
/// <summary>
|
||||
/// 按 PropConfigData 构建一级道具列表(只在首次打开时构建一次)
|
||||
/// </summary>
|
||||
@@ -1505,12 +1522,42 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
|
||||
var cfg = propConfigData.props[i];
|
||||
if (cfg == null) continue;
|
||||
var item = Instantiate(tmp_PropItem, obj_PropItemParent.transform);
|
||||
SetPropItemText(item, cfg.name);
|
||||
// ⭐ 第一层 child0 = 数量 TMP(只显示数字,不显示名字,靠图标辨识)
|
||||
SetPropItemIcon(item, cfg.icon);
|
||||
var data = cfg; // 闭包捕获当前项,避免循环变量被覆盖
|
||||
var btn = GetPropItemButton(item);
|
||||
if (btn != null) btn.onClick.AddListener(() => ShowPropTwo(data));
|
||||
_propFirstLayerItems.Add(new KeyValuePair<PropItemData, GameObject>(cfg, item));
|
||||
}
|
||||
RefreshPropFirstLayerCounts();
|
||||
}
|
||||
|
||||
/// <summary>刷新一级道具 child0 数量:仅当该类型下只有 1 个已拥有道具(点击直接使用、不弹二层)时显示个数;
|
||||
/// 可以打开二层的一级项(0 个显示"暂无道具"占位 / 多个展开子道具列表)直接显示空</summary>
|
||||
private void RefreshPropFirstLayerCounts()
|
||||
{
|
||||
foreach (var kv in _propFirstLayerItems)
|
||||
{
|
||||
if (kv.Value == null) continue; // 克隆项已被销毁
|
||||
var matched = GetMatchedProps(kv.Key != null ? kv.Key.propType : PropEnum.none);
|
||||
// ⭐ 只有 1 个已拥有道具(点击直达使用)才显示个数;能弹二层的显示空
|
||||
SetPropItemTextAt(kv.Value, 0, matched.Count == 1 ? matched[0].count.ToString() : string.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>按类型读取后端已拥有道具(none = 全部类型),只取 count > 0 的(一级角标与二级展开共用同一过滤规则)</summary>
|
||||
private List<BaseProductCount> GetMatchedProps(PropEnum type)
|
||||
{
|
||||
var matched = new List<BaseProductCount>();
|
||||
var props = GameManager.Instance.user?.props;
|
||||
if (props == null) return matched;
|
||||
foreach (var p in props)
|
||||
{
|
||||
if (p == null || p.count <= 0) continue;
|
||||
if (type != PropEnum.none && p.type != (int)type) continue;
|
||||
matched.Add(p);
|
||||
}
|
||||
return matched;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1530,17 +1577,8 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
|
||||
}
|
||||
|
||||
// ⭐ 读取后端道具:按一级道具配置的类型过滤(none = 显示全部),只显示 count > 0 的
|
||||
var matched = new List<BaseProductCount>();
|
||||
var props = GameManager.Instance.user?.props;
|
||||
if (props != null)
|
||||
{
|
||||
foreach (var p in props)
|
||||
{
|
||||
if (p == null || p.count <= 0) continue;
|
||||
if (cfg.propType != PropEnum.none && p.type != (int)cfg.propType) continue;
|
||||
matched.Add(p);
|
||||
}
|
||||
}
|
||||
// (与一级角标 RefreshPropFirstLayerCounts 共用 GetMatchedProps,规则一致)
|
||||
var matched = GetMatchedProps(cfg.propType);
|
||||
|
||||
// ⭐ 只有 1 个时不用弹二层,直接触发该道具的使用效果
|
||||
if (matched.Count == 1)
|
||||
@@ -1552,7 +1590,9 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
|
||||
foreach (var p in matched)
|
||||
{
|
||||
var item = Instantiate(tmp_PropTwoItem, tmp_PropTwoItemParent.transform);
|
||||
SetPropItemText(item, $"{p.name} x{p.count}");
|
||||
// ⭐ child0 = 名字,child1 = 数量(tmp_PropTwoItem 的 child1 是数量 TMP)
|
||||
SetPropItemText(item, p.name);
|
||||
SetPropItemTextAt(item, 1, p.count.ToString());
|
||||
SetPropItemIconUrl(item, p.imageUrl);
|
||||
var data = p; // 闭包捕获当前项
|
||||
var btn = GetPropItemButton(item);
|
||||
@@ -1601,6 +1641,7 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
|
||||
{
|
||||
if (user != null)
|
||||
GameManager.Instance.UpdataUserData(user);
|
||||
RefreshPropFirstLayerCounts(); // 数量变化后同步刷新一级角标
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -1641,6 +1682,15 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
|
||||
if (tmp != null) tmp.text = text;
|
||||
}
|
||||
|
||||
/// <summary>克隆项固定子节点文本:按索引取 child{childIndex} 的 TMP(如第一层child0数量、第二层child1数量)</summary>
|
||||
private void SetPropItemTextAt(GameObject item, int childIndex, string text)
|
||||
{
|
||||
var tmp = item.transform.childCount > childIndex
|
||||
? item.transform.GetChild(childIndex).GetComponent<TextMeshProUGUI>()
|
||||
: null;
|
||||
if (tmp != null) tmp.text = text;
|
||||
}
|
||||
|
||||
/// <summary>克隆项图标:优先取 child0 的 Image,再退回自身/子级查找(icon 不填则跳过)</summary>
|
||||
private void SetPropItemIcon(GameObject item, Sprite icon)
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -163,6 +163,7 @@ GameObject:
|
||||
- component: {fileID: 124719504025702002}
|
||||
- component: {fileID: 891784771157540747}
|
||||
- component: {fileID: 2138495588824865777}
|
||||
- component: {fileID: 7293335200642149305}
|
||||
m_Layer: 0
|
||||
m_Name: spine
|
||||
m_TagString: Untagged
|
||||
@@ -211,7 +212,7 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 0}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
@@ -228,6 +229,50 @@ MonoBehaviour:
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!114 &7293335200642149305
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 710577801722791332}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Navigation:
|
||||
m_Mode: 3
|
||||
m_WrapAround: 0
|
||||
m_SelectOnUp: {fileID: 0}
|
||||
m_SelectOnDown: {fileID: 0}
|
||||
m_SelectOnLeft: {fileID: 0}
|
||||
m_SelectOnRight: {fileID: 0}
|
||||
m_Transition: 1
|
||||
m_Colors:
|
||||
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
|
||||
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
|
||||
m_ColorMultiplier: 1
|
||||
m_FadeDuration: 0.1
|
||||
m_SpriteState:
|
||||
m_HighlightedSprite: {fileID: 0}
|
||||
m_PressedSprite: {fileID: 0}
|
||||
m_SelectedSprite: {fileID: 0}
|
||||
m_DisabledSprite: {fileID: 0}
|
||||
m_AnimationTriggers:
|
||||
m_NormalTrigger: Normal
|
||||
m_HighlightedTrigger: Highlighted
|
||||
m_PressedTrigger: Pressed
|
||||
m_SelectedTrigger: Selected
|
||||
m_DisabledTrigger: Disabled
|
||||
m_Interactable: 1
|
||||
m_TargetGraphic: {fileID: 2138495588824865777}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!1 &776549303669873539
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -324,9 +369,9 @@ MonoBehaviour:
|
||||
m_fontSize: 20
|
||||
m_fontSizeBase: 20
|
||||
m_fontWeight: 400
|
||||
m_enableAutoSizing: 0
|
||||
m_fontSizeMin: 18
|
||||
m_fontSizeMax: 72
|
||||
m_enableAutoSizing: 1
|
||||
m_fontSizeMin: 15
|
||||
m_fontSizeMax: 20
|
||||
m_fontStyle: 0
|
||||
m_HorizontalAlignment: 2
|
||||
m_VerticalAlignment: 512
|
||||
@@ -652,7 +697,7 @@ MonoBehaviour:
|
||||
m_TargetGraphic: {fileID: 2625315590455211500}
|
||||
toggleTransition: 1
|
||||
graphic: {fileID: 0}
|
||||
m_Group: {fileID: 0}
|
||||
m_Group: {fileID: 7002796641863660046}
|
||||
onValueChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls:
|
||||
@@ -668,7 +713,7 @@ MonoBehaviour:
|
||||
m_StringArgument:
|
||||
m_BoolArgument: 0
|
||||
m_CallState: 2
|
||||
- m_Target: {fileID: 2272410985116252593}
|
||||
- m_Target: {fileID: 3717529941235210696}
|
||||
m_TargetAssemblyTypeName: UnityEngine.GameObject, UnityEngine
|
||||
m_MethodName: SetActive
|
||||
m_Mode: 0
|
||||
@@ -860,6 +905,7 @@ GameObject:
|
||||
- component: {fileID: 3932123644494921910}
|
||||
- component: {fileID: 5015246569833944093}
|
||||
- component: {fileID: 6121721415783472745}
|
||||
- component: {fileID: 174520928302800535}
|
||||
m_Layer: 0
|
||||
m_Name: zi
|
||||
m_TagString: Untagged
|
||||
@@ -908,7 +954,7 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 0}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
@@ -925,6 +971,50 @@ MonoBehaviour:
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!114 &174520928302800535
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2272410985116252593}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Navigation:
|
||||
m_Mode: 3
|
||||
m_WrapAround: 0
|
||||
m_SelectOnUp: {fileID: 0}
|
||||
m_SelectOnDown: {fileID: 0}
|
||||
m_SelectOnLeft: {fileID: 0}
|
||||
m_SelectOnRight: {fileID: 0}
|
||||
m_Transition: 1
|
||||
m_Colors:
|
||||
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
|
||||
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
|
||||
m_ColorMultiplier: 1
|
||||
m_FadeDuration: 0.1
|
||||
m_SpriteState:
|
||||
m_HighlightedSprite: {fileID: 0}
|
||||
m_PressedSprite: {fileID: 0}
|
||||
m_SelectedSprite: {fileID: 0}
|
||||
m_DisabledSprite: {fileID: 0}
|
||||
m_AnimationTriggers:
|
||||
m_NormalTrigger: Normal
|
||||
m_HighlightedTrigger: Highlighted
|
||||
m_PressedTrigger: Pressed
|
||||
m_SelectedTrigger: Selected
|
||||
m_DisabledTrigger: Disabled
|
||||
m_Interactable: 1
|
||||
m_TargetGraphic: {fileID: 6121721415783472745}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!1 &2779536391356234546
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -1135,7 +1225,7 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 0.392}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 0}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
@@ -1763,7 +1853,7 @@ GameObject:
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
m_IsActive: 0
|
||||
--- !u!224 &4020021969620843113
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -1805,7 +1895,7 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 0.392}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 0}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
@@ -2085,7 +2175,7 @@ MonoBehaviour:
|
||||
m_TargetGraphic: {fileID: 4999646497816926684}
|
||||
toggleTransition: 1
|
||||
graphic: {fileID: 0}
|
||||
m_Group: {fileID: 0}
|
||||
m_Group: {fileID: 7002796641863660046}
|
||||
onValueChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls:
|
||||
@@ -2328,7 +2418,7 @@ GameObject:
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
m_IsActive: 0
|
||||
--- !u!224 &2186040556532222527
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e5efa9f179bbfdb4ba8e73fe85eb109a
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -4015,6 +4015,7 @@ RectTransform:
|
||||
- {fileID: 4415992113508979064}
|
||||
- {fileID: 6172531420321643531}
|
||||
- {fileID: 38992651813133378}
|
||||
- {fileID: 8731040328321709014}
|
||||
- {fileID: 2421507470733538738}
|
||||
- {fileID: 6665898966579201677}
|
||||
- {fileID: 755472782897628008}
|
||||
@@ -4052,14 +4053,38 @@ MonoBehaviour:
|
||||
btn_QuXiao: {fileID: 2238313060525282867}
|
||||
sceneName: XJMH
|
||||
gameType: 4
|
||||
propConfigData: {fileID: 0}
|
||||
btn_Prop: {fileID: 0}
|
||||
obj_PropItemParent: {fileID: 0}
|
||||
obj_PropPanel: {fileID: 0}
|
||||
tmp_PropItem: {fileID: 0}
|
||||
tmp_PropTwoItemParent: {fileID: 0}
|
||||
tmp_PropTwoPanel: {fileID: 0}
|
||||
tmp_PropTwoItem: {fileID: 0}
|
||||
dalaba: {fileID: 0}
|
||||
zhanhuanka: {fileID: 0}
|
||||
huojianpao: {fileID: 0}
|
||||
obj_DaLaBaPanel: {fileID: 0}
|
||||
tmp_DaLaBaInput: {fileID: 0}
|
||||
btn_DaLaBaSend: {fileID: 0}
|
||||
btn_DaLaBaClose: {fileID: 0}
|
||||
btn_SettingList: {fileID: 7409283134322969632}
|
||||
SittingListParent: {fileID: 838072981635609327}
|
||||
btn_TuJian: {fileID: 8779502177911634185}
|
||||
btn_ChangeTurret: {fileID: 1167035719947141973}
|
||||
btn_TuiChu: {fileID: 2288511243238812163}
|
||||
btn_Setting: {fileID: 6737352122242343368}
|
||||
btn_ChangeRoom: {fileID: 0}
|
||||
biaoQingConfig: {fileID: 0}
|
||||
btn_BiaoQing: {fileID: 0}
|
||||
obj_BiaoQingPanel: {fileID: 0}
|
||||
obj_BiaoQingZiItemPrefab: {fileID: 0}
|
||||
obj_BiaoQingSpineItemPrefab: {fileID: 0}
|
||||
obj_BiaoQingSpineItemParent: {fileID: 0}
|
||||
obj_BiaoQingZiItemParent: {fileID: 0}
|
||||
list_BiaoQingSpine: []
|
||||
list_BiaoQingZi: []
|
||||
mySitAnim: {fileID: 448370382151683116}
|
||||
toggle_SkillAuto: {fileID: 5811737153799833063}
|
||||
toggle_Lock: {fileID: 1095565694137767186}
|
||||
toggle_Three: {fileID: 557993769889242771}
|
||||
toggle_Shuang: {fileID: 6788830007509759241}
|
||||
@@ -4092,6 +4117,11 @@ MonoBehaviour:
|
||||
JinDuTiao: {fileID: 4665099600232146800}
|
||||
isFrenzy: 0
|
||||
laserHitDelay: 0.2
|
||||
sanSheNearDistance: 10
|
||||
sanSheFarDistance: 35
|
||||
sanSheMaxBulge: 6
|
||||
sanSheMinBulge: 4
|
||||
sanSheSideBulletSpeed: 50
|
||||
sitBulletMaxCount: 100
|
||||
fanRadius: 160
|
||||
fanArcSpan: 150
|
||||
@@ -8640,6 +8670,19 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 16cfaab69e1fa404dbb8432276bd7537, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
spineObj: {fileID: 0}
|
||||
ziObj: {fileID: 0}
|
||||
btn_SelectPaoBei: {fileID: 0}
|
||||
selectPaoBeiPanel: {fileID: 0}
|
||||
paobeiItemPrefab: {fileID: 0}
|
||||
paobeiItemParent: {fileID: 0}
|
||||
redBG: {fileID: 0}
|
||||
purpleBG: {fileID: 0}
|
||||
blueBG: {fileID: 0}
|
||||
yellowBG: {fileID: 0}
|
||||
toggle_AutoAttack: {fileID: 0}
|
||||
openPTLongPressTime: 0.5
|
||||
img_OpenPT: {fileID: 0}
|
||||
IsBaoJiangingActive: 0
|
||||
obj_BaoJiangZhongPanelPosition: {fileID: 0}
|
||||
user:
|
||||
@@ -8680,6 +8723,7 @@ MonoBehaviour:
|
||||
btn_TurretMinus: {fileID: 3791490403191831607}
|
||||
JGFXLeftParent: {fileID: 0}
|
||||
JGFXRightParent: {fileID: 0}
|
||||
biaoQingDuration: 3
|
||||
--- !u!1 &5860008427732613124
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -8846,6 +8890,19 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 16cfaab69e1fa404dbb8432276bd7537, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
spineObj: {fileID: 0}
|
||||
ziObj: {fileID: 0}
|
||||
btn_SelectPaoBei: {fileID: 0}
|
||||
selectPaoBeiPanel: {fileID: 0}
|
||||
paobeiItemPrefab: {fileID: 0}
|
||||
paobeiItemParent: {fileID: 0}
|
||||
redBG: {fileID: 0}
|
||||
purpleBG: {fileID: 0}
|
||||
blueBG: {fileID: 0}
|
||||
yellowBG: {fileID: 0}
|
||||
toggle_AutoAttack: {fileID: 0}
|
||||
openPTLongPressTime: 0.5
|
||||
img_OpenPT: {fileID: 0}
|
||||
IsBaoJiangingActive: 0
|
||||
obj_BaoJiangZhongPanelPosition: {fileID: 0}
|
||||
user:
|
||||
@@ -8882,6 +8939,7 @@ MonoBehaviour:
|
||||
btn_TurretMinus: {fileID: 0}
|
||||
JGFXLeftParent: {fileID: 0}
|
||||
JGFXRightParent: {fileID: 0}
|
||||
biaoQingDuration: 3
|
||||
--- !u!1 &6062038920967736247
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -13785,6 +13843,130 @@ MonoBehaviour:
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!1001 &407003521196400366
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 245637205031072731}
|
||||
m_Modifications:
|
||||
- target: {fileID: 838781140978391389, guid: 87a141ee6b07c324b91593c88bd1db9c,
|
||||
type: 3}
|
||||
propertyPath: m_Name
|
||||
value: 'Setting '
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8975416087219219768, guid: 87a141ee6b07c324b91593c88bd1db9c,
|
||||
type: 3}
|
||||
propertyPath: m_Pivot.x
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8975416087219219768, guid: 87a141ee6b07c324b91593c88bd1db9c,
|
||||
type: 3}
|
||||
propertyPath: m_Pivot.y
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8975416087219219768, guid: 87a141ee6b07c324b91593c88bd1db9c,
|
||||
type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8975416087219219768, guid: 87a141ee6b07c324b91593c88bd1db9c,
|
||||
type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8975416087219219768, guid: 87a141ee6b07c324b91593c88bd1db9c,
|
||||
type: 3}
|
||||
propertyPath: m_AnchorMin.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8975416087219219768, guid: 87a141ee6b07c324b91593c88bd1db9c,
|
||||
type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8975416087219219768, guid: 87a141ee6b07c324b91593c88bd1db9c,
|
||||
type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 91
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8975416087219219768, guid: 87a141ee6b07c324b91593c88bd1db9c,
|
||||
type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 91
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8975416087219219768, guid: 87a141ee6b07c324b91593c88bd1db9c,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8975416087219219768, guid: 87a141ee6b07c324b91593c88bd1db9c,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8975416087219219768, guid: 87a141ee6b07c324b91593c88bd1db9c,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8975416087219219768, guid: 87a141ee6b07c324b91593c88bd1db9c,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8975416087219219768, guid: 87a141ee6b07c324b91593c88bd1db9c,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8975416087219219768, guid: 87a141ee6b07c324b91593c88bd1db9c,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8975416087219219768, guid: 87a141ee6b07c324b91593c88bd1db9c,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8975416087219219768, guid: 87a141ee6b07c324b91593c88bd1db9c,
|
||||
type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 128.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8975416087219219768, guid: 87a141ee6b07c324b91593c88bd1db9c,
|
||||
type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: -169.49991
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8975416087219219768, guid: 87a141ee6b07c324b91593c88bd1db9c,
|
||||
type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8975416087219219768, guid: 87a141ee6b07c324b91593c88bd1db9c,
|
||||
type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8975416087219219768, guid: 87a141ee6b07c324b91593c88bd1db9c,
|
||||
type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 87a141ee6b07c324b91593c88bd1db9c, type: 3}
|
||||
--- !u!224 &8731040328321709014 stripped
|
||||
RectTransform:
|
||||
m_CorrespondingSourceObject: {fileID: 8975416087219219768, guid: 87a141ee6b07c324b91593c88bd1db9c,
|
||||
type: 3}
|
||||
m_PrefabInstance: {fileID: 407003521196400366}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1001 &604499093651417790
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
@@ -5,6 +5,7 @@ using DG.Tweening;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
@@ -16,6 +17,7 @@ public class UIHome_BY_UISignViewPanel : SubUIBase
|
||||
转盘停靠位置用奖励金额反查signConfigs得到(见FindSlotByReward)*/
|
||||
//SLZPDieEvent这个脚本有之前写好的多层转盘的逻辑 签到这里只有单层 你可以直接看一下里面正确的
|
||||
public List<Text> text_CoinNums;
|
||||
public List<TextMeshProUGUI> text_CoinNums_TMP;
|
||||
public Button btn_ChouJiang;
|
||||
public GameObject zhuanPan;
|
||||
Dictionary<int, SignConfig> order_singConfig;
|
||||
@@ -36,6 +38,7 @@ public class UIHome_BY_UISignViewPanel : SubUIBase
|
||||
protected override void OnShow(object args = null)
|
||||
{
|
||||
base.OnShow(args);
|
||||
OnChouJiangClick();
|
||||
RefreshPanel();
|
||||
}
|
||||
|
||||
@@ -70,21 +73,38 @@ public class UIHome_BY_UISignViewPanel : SubUIBase
|
||||
return vipCfg?.signInAdd ?? 0;
|
||||
}
|
||||
|
||||
/// <summary>转盘格子数量:UGUI Text列表有绑定就用它,否则用TMP列表</summary>
|
||||
private int SlotCount()
|
||||
{
|
||||
if (text_CoinNums != null && text_CoinNums.Count > 0) return text_CoinNums.Count;
|
||||
return text_CoinNums_TMP != null ? text_CoinNums_TMP.Count : 0;
|
||||
}
|
||||
|
||||
/// <summary>给第index个转盘格子设置文本(兼容UGUI Text与TMP)</summary>
|
||||
private void SetSlotText(int index, string value)
|
||||
{
|
||||
if (text_CoinNums != null && index < text_CoinNums.Count)
|
||||
text_CoinNums[index].text = value;
|
||||
else if (text_CoinNums_TMP != null && index < text_CoinNums_TMP.Count)
|
||||
text_CoinNums_TMP[index].text = value;
|
||||
}
|
||||
|
||||
/// <summary>转盘格子赋值:值+值*signInAdd(VIP签到加成),按order排序后与text_CoinNums一一对应</summary>
|
||||
private void UpdateSlotTexts()
|
||||
{
|
||||
if (order_singConfig == null || order_singConfig.Count == 0 || text_CoinNums == null) return;
|
||||
int slotCount = SlotCount();
|
||||
if (order_singConfig == null || order_singConfig.Count == 0 || slotCount == 0) return;
|
||||
|
||||
var list = new List<SignConfig>(order_singConfig.Values);
|
||||
list.Sort((a, b) => a.order - b.order);
|
||||
|
||||
double add = GetSignInAdd();
|
||||
int count = Mathf.Min(list.Count, text_CoinNums.Count);
|
||||
int count = Mathf.Min(list.Count, slotCount);
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
long gold = list[i].gold;
|
||||
long showGold = gold + (long)Math.Round(gold * add);
|
||||
text_CoinNums[i].text = FormatGold(showGold);
|
||||
SetSlotText(i, FormatGold(showGold));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,13 +156,13 @@ public class UIHome_BY_UISignViewPanel : SubUIBase
|
||||
/// <summary>按奖励金额反查转盘格子:优先匹配加了VIP加成后的值,其次匹配原始配置值;匹配不到返回-1</summary>
|
||||
private int FindSlotByReward(long reward)
|
||||
{
|
||||
if (order_singConfig == null || order_singConfig.Count == 0 || text_CoinNums == null || text_CoinNums.Count == 0) return -1;
|
||||
if (order_singConfig == null || order_singConfig.Count == 0 || SlotCount() == 0) return -1;
|
||||
|
||||
var list = new List<SignConfig>(order_singConfig.Values);
|
||||
list.Sort((a, b) => a.order - b.order);
|
||||
|
||||
double add = GetSignInAdd();
|
||||
int count = Mathf.Min(list.Count, text_CoinNums.Count);
|
||||
int count = Mathf.Min(list.Count, SlotCount());
|
||||
int fallback = -1;
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
@@ -158,7 +178,7 @@ public class UIHome_BY_UISignViewPanel : SubUIBase
|
||||
private void RotateToSlot(int slot, Action onComplete)
|
||||
{
|
||||
isSpinning = true;
|
||||
int cellCount = text_CoinNums.Count > 0 ? text_CoinNums.Count : 1;
|
||||
int cellCount = Mathf.Max(SlotCount(), 1);
|
||||
float targetAngle = slot * (360f / cellCount);
|
||||
|
||||
float curr = zhuanPan.transform.localRotation.eulerAngles.z;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user