parent
a9a61e0709
commit
0888bc4658
|
|
@ -75,7 +75,7 @@ namespace Guru.Editor
|
||||||
string symbolDefine = buildParam.IsBuildRelease ? GameDefine.MACRO_RELEASE : GameDefine.MACRO_DEBUG;
|
string symbolDefine = buildParam.IsBuildRelease ? GameDefine.MACRO_RELEASE : GameDefine.MACRO_DEBUG;
|
||||||
string apkPath = string.Empty;
|
string apkPath = string.Empty;
|
||||||
string version = Application.version;
|
string version = Application.version;
|
||||||
string extension = buildParam.IsBuildRelease ? ".aab" : ".apk";
|
string extension = buildParam.IsBuildAAB ? ".aab" : ".apk";
|
||||||
if (EditorUserBuildSettings.exportAsGoogleAndroidProject) extension = ""; // 输出工程
|
if (EditorUserBuildSettings.exportAsGoogleAndroidProject) extension = ""; // 输出工程
|
||||||
string outputDir = Path.GetFullPath($"{Application.dataPath }/../BuildOutput/Android");
|
string outputDir = Path.GetFullPath($"{Application.dataPath }/../BuildOutput/Android");
|
||||||
apkPath = $"{outputDir}/{Application.productName.Replace(" ","_")}_{symbolDefine}_{version}_{buildNumber}{extension}";
|
apkPath = $"{outputDir}/{Application.productName.Replace(" ","_")}_{symbolDefine}_{version}_{buildNumber}{extension}";
|
||||||
|
|
|
||||||
|
|
@ -194,7 +194,7 @@ namespace Guru
|
||||||
|
|
||||||
private static void SetIDFV()
|
private static void SetIDFV()
|
||||||
{
|
{
|
||||||
GuruAnalytics.SetAndroidID(DeviceIDHelper.IDFV);
|
GuruAnalytics.SetIDFV(DeviceIDHelper.IDFV);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,9 @@ namespace Guru
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Facebook.Unity;
|
using Facebook.Unity;
|
||||||
|
|
||||||
|
// item_category: reward/iap_buy/igc/props/bonus/behavior/others
|
||||||
|
// item_name:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 经济统计接口
|
/// 经济统计接口
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -27,9 +30,47 @@ namespace Guru
|
||||||
public const string CurrencyNameCopper = "copper";
|
public const string CurrencyNameCopper = "copper";
|
||||||
|
|
||||||
//----------- 货币类型常用名称 ------------------
|
//----------- 货币类型常用名称 ------------------
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 货币获取的类别
|
||||||
|
/// </summary>
|
||||||
|
public enum CurrencyCategory
|
||||||
|
{
|
||||||
|
Reward,
|
||||||
|
IapBuy,
|
||||||
|
Igc,
|
||||||
|
Props,
|
||||||
|
Bonus,
|
||||||
|
Behavior,
|
||||||
|
Others,
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 枚举转字符串
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="category"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
private static string GetCategoryString(CurrencyCategory category)
|
||||||
|
{
|
||||||
|
switch (category)
|
||||||
|
{
|
||||||
|
case CurrencyCategory.Reward:
|
||||||
|
return "reward";
|
||||||
|
case CurrencyCategory.IapBuy:
|
||||||
|
return "iap_buy";
|
||||||
|
case CurrencyCategory.Igc:
|
||||||
|
return "igc";
|
||||||
|
case CurrencyCategory.Props:
|
||||||
|
return "props";
|
||||||
|
case CurrencyCategory.Bonus:
|
||||||
|
return "bonus";
|
||||||
|
case CurrencyCategory.Behavior:
|
||||||
|
return "behavior";
|
||||||
|
}
|
||||||
|
return "others";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取虚拟货币
|
/// 获取虚拟货币
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -51,7 +92,7 @@ namespace Guru
|
||||||
if (isIap) method = "iap_buy";
|
if (isIap) method = "iap_buy";
|
||||||
var data = new Dictionary<string, dynamic>()
|
var data = new Dictionary<string, dynamic>()
|
||||||
{
|
{
|
||||||
{ "virtual_currency_name", currencyName },
|
{ ParameterVirtualCurrencyName, currencyName },
|
||||||
{ ParameterValue, value },
|
{ ParameterValue, value },
|
||||||
{ ParameterBalance, balance },
|
{ ParameterBalance, balance },
|
||||||
{ ParameterLevelName, levelName },
|
{ ParameterLevelName, levelName },
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,8 @@
|
||||||
|
|
||||||
using UnityEngine;
|
|
||||||
using UnityEngine.Serialization;
|
|
||||||
|
|
||||||
namespace Guru
|
namespace Guru
|
||||||
{
|
{
|
||||||
using System;
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
using UnityEngine.Purchasing;
|
using UnityEngine.Purchasing;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -58,8 +56,7 @@ namespace Guru
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 商品信息
|
/// 商品信息
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -75,12 +72,11 @@ namespace Guru
|
||||||
public string Name => Setting.ProductName;
|
public string Name => Setting.ProductName;
|
||||||
public string Id => Product.definition.id;
|
public string Id => Product.definition.id;
|
||||||
public double Price => (double?)Product?.metadata?.localizedPrice ?? Setting.Price;
|
public double Price => (double?)Product?.metadata?.localizedPrice ?? Setting.Price;
|
||||||
public string CurrencyCode => Product?.metadata?.isoCurrencyCode ?? "USD";
|
public string CurrencyCode => Product?.metadata?.isoCurrencyCode ?? "$";
|
||||||
public string Category => Setting.Category;
|
public string Category => Setting.Category;
|
||||||
public string Type => Setting.Type == ProductType.Subscription ? "subscription" : "product";
|
public string Type => Setting.Type == ProductType.Subscription ? "subscription" : "product";
|
||||||
public bool IsFree => Setting.IsFree;
|
public bool IsFree => Setting.IsFree;
|
||||||
public string LocalizedPriceString => Product?.metadata.localizedPriceString ?? $"{CurrencyCode}{Setting.Price}";
|
public string LocalizedPriceString => Product?.metadata.localizedPriceString ?? $"{CurrencyCode}{Setting.Price}";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue