|
|
@@ -510,6 +510,58 @@ public partial class SDKMgr : MonoBehaviour
|
|
|
BuglyAgent.SetUserId (userId);
|
|
|
#endif
|
|
|
}
|
|
|
+ public class ProductInfo
|
|
|
+ {
|
|
|
+ public string ID;
|
|
|
+ public string Name;
|
|
|
+ public string CID;
|
|
|
+ public string Other;
|
|
|
+ }
|
|
|
+
|
|
|
+ public Dictionary<string, ProductInfo> ProductInfos = new Dictionary<string, ProductInfo>()
|
|
|
+ {
|
|
|
+ { "0.99",new ProductInfo(){ CID = "1",Name = "0.99禮包"} },
|
|
|
+ { "1.99",new ProductInfo(){ CID = "2",Name = "1.99禮包"} },
|
|
|
+ { "2.99",new ProductInfo(){ CID = "3",Name = "2.99禮包"} },
|
|
|
+ { "4.99",new ProductInfo(){ CID = "4",Name = "4.99禮包"} },
|
|
|
+ { "9.99",new ProductInfo(){ CID = "5",Name = "9.99禮包"} },
|
|
|
+ { "14.99",new ProductInfo(){ CID = "6",Name = "14.99禮包"} },
|
|
|
+ { "19.99",new ProductInfo(){ CID = "7",Name = "19.99禮包"} },
|
|
|
+ { "49.99",new ProductInfo(){ CID = "8",Name = "49.99禮包"} },
|
|
|
+ { "99.99",new ProductInfo(){ CID = "9",Name = "99.99禮包"} },
|
|
|
+ };
|
|
|
+
|
|
|
+
|
|
|
+ public void InitProductCfg(Dictionary<string, Dictionary<string, string>> cfg)
|
|
|
+ {
|
|
|
+ foreach (var item in cfg)
|
|
|
+ {
|
|
|
+ string id = item.Key;
|
|
|
+ string pid = item.Value["productID"];
|
|
|
+ string name = item.Value["productName"];
|
|
|
+ string amount = item.Value["amount"];
|
|
|
+ string other = item.Value["other"];
|
|
|
+ if (ProductInfos.ContainsKey(amount))
|
|
|
+ {
|
|
|
+ ProductInfos[amount].ID = pid;
|
|
|
+ ProductInfos[amount].Name = name;
|
|
|
+ ProductInfos[amount].Other = other;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ ProductInfos.Add(amount, new ProductInfo()
|
|
|
+ {
|
|
|
+ ID= pid,
|
|
|
+ CID = id,
|
|
|
+ Name = name,
|
|
|
+ Other = other,
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ //Debug.Log($"===== 商品配置 {name} ======");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
public class MethodMaker
|
|
|
{
|