浮漂脚本
This commit is contained in:
3
Assets/Scripts/Common/Config.meta
Normal file
3
Assets/Scripts/Common/Config.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 31917665a76642349dc8f420e9e69e10
|
||||
timeCreated: 1763900632
|
||||
26
Assets/Scripts/Common/Config/GoodsConfig.cs
Normal file
26
Assets/Scripts/Common/Config/GoodsConfig.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
public partial class GoodsConfig
|
||||
{
|
||||
private List<AwardData> _awards;
|
||||
|
||||
public List<AwardData> Awards
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_awards == null)
|
||||
{
|
||||
_awards = new List<AwardData>();
|
||||
foreach (var item in Items)
|
||||
{
|
||||
_awards.Add(new AwardData(item));
|
||||
}
|
||||
}
|
||||
|
||||
return _awards;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Assets/Scripts/Common/Config/GoodsConfig.cs.meta
Normal file
3
Assets/Scripts/Common/Config/GoodsConfig.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f2ff9451a42f4d9e8ebec6b8c8088103
|
||||
timeCreated: 1763900639
|
||||
22
Assets/Scripts/Common/Data/AwardData.cs
Normal file
22
Assets/Scripts/Common/Data/AwardData.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
namespace NBF
|
||||
{
|
||||
public class AwardData
|
||||
{
|
||||
public uint Id;
|
||||
public int Amount;
|
||||
|
||||
public AwardData(string str)
|
||||
{
|
||||
string[] parts = str.Split('|');
|
||||
Id = uint.Parse(parts[0]);
|
||||
if (parts.Length > 1)
|
||||
{
|
||||
Amount = int.Parse(parts[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
Amount = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Assets/Scripts/Common/Data/AwardData.cs.meta
Normal file
3
Assets/Scripts/Common/Data/AwardData.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a62ec00b6df5428ca380168860d73a58
|
||||
timeCreated: 1763900506
|
||||
6
Assets/Scripts/Common/Enum/GoodsType.cs
Normal file
6
Assets/Scripts/Common/Enum/GoodsType.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace NBF
|
||||
{
|
||||
public enum GoodsType
|
||||
{
|
||||
}
|
||||
}
|
||||
3
Assets/Scripts/Common/Enum/GoodsType.cs.meta
Normal file
3
Assets/Scripts/Common/Enum/GoodsType.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b3636032a57e4125907ad7a1df411c52
|
||||
timeCreated: 1763892955
|
||||
@@ -3,18 +3,18 @@
|
||||
public enum ItemType
|
||||
{
|
||||
None,
|
||||
Currency,
|
||||
Item,
|
||||
Rod,
|
||||
Reel,
|
||||
Bobber,
|
||||
Line,
|
||||
Bait,
|
||||
Lure,
|
||||
Hook,
|
||||
Weight,
|
||||
Feeder,
|
||||
Ring
|
||||
Currency = 1,
|
||||
Item = 2,
|
||||
Rod = 3,
|
||||
Reel =4,
|
||||
Bobber = 5,
|
||||
Line = 6,
|
||||
Bait = 7,
|
||||
Lure = 8,
|
||||
Hook = 9,
|
||||
Weight = 10,
|
||||
Feeder = 11,
|
||||
|
||||
}
|
||||
|
||||
public enum ItemSubType
|
||||
|
||||
@@ -16,16 +16,7 @@ namespace NBF.Utils
|
||||
{
|
||||
return (ItemType)(id / 10000);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取物品子类型
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public static uint GetItemSubType(this uint id)
|
||||
{
|
||||
return (id / 1000) % 10;
|
||||
}
|
||||
|
||||
|
||||
public static string GetName(this uint id)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user