進捗データ計測追加

This commit is contained in:
atusi 2022-02-04 21:03:23 +09:00
parent 620070e42f
commit b476d1a390
5 changed files with 29 additions and 11 deletions

View File

@ -7,6 +7,7 @@ using UniRx;
using UnityEngine;
using UnityEngine.PlayerLoop;
using UnityEngine.UI;
using GameAnalyticsSDK;
public class ShopLevelUp : MonoBehaviour
{
@ -93,6 +94,13 @@ public class ShopLevelUp : MonoBehaviour
LocalCacheManager.Load<Action>(CallbackTag, null)?.Invoke();
LocalCacheManager.Remove(CallbackTag);
}
#if !DEVELOPMENT_BUILD && !UNITY_EDITOR
// 進捗計測
var progress = "level_" + String.Format("{0:00}", shopLevel);
// 進捗スコアを保存 TODO:暫定的にログインカウントを保存する
var score = GameDataManager.GameData.dailyLoginCount;
GameAnalytics.NewProgressionEvent(GAProgressionStatus.Complete, progress, score);
#endif
}
public static void ShowDialog(int level, Action onComplete = null)

View File

@ -1,8 +1,16 @@
using System;
using UnityEngine;
using GameAnalyticsSDK;
public sealed class AdManager : SingletonMonoBehaviour<AdManager> {
public static readonly string AD_PLACEMENT_COIN = "coin";
public static readonly string AD_PLACEMENT_CORNFIELD = "cornfield";
public static readonly string AD_PLACEMENT_CUSTOMER = "increase_customer";
public static readonly string AD_PLACEMENT_PERFECT = "perfect_popcorn";
public static readonly string AD_PLACEMENT_VIP = "vip_customer";
public static readonly string AD_PLACEMENT_AUTO = "auto_popcorn";
//-- ironSource --//
#if UNITY_IOS
private static readonly string IRONSOURCE_APP_KEY = "11bc8b5ad";
@ -107,7 +115,7 @@ public sealed class AdManager : SingletonMonoBehaviour<AdManager> {
return IronSource.Agent.isRewardedVideoAvailable();
#endif
}
public void ShowRewardVideo(Action<bool> callback){
public void ShowRewardVideo(Action<bool> callback, string ad_placement = "none"){
#if UNITY_EDITOR
callback(true);
#else
@ -120,6 +128,9 @@ public sealed class AdManager : SingletonMonoBehaviour<AdManager> {
_rewardAdClose = false;
_async_frame_count = 0;
IronSource.Agent.showRewardedVideo();
#if !DEVELOPMENT_BUILD && !UNITY_EDITOR
GameAnalytics.NewAdEvent(GAAdAction.FailedShow, GAAdType.RewardedVideo, "ironsource", ad_placement);
#endif
}else{
_rewardAdCallback(false);
}

View File

@ -4,7 +4,7 @@ public static class Const {
public static readonly string UnityVersion = "2019.4.19f1";
public static readonly string DefaultAppVersion = "0.1.0";
public static readonly string DefaultAppVersion = "1.1.0";
// parameter
public static readonly int DefaultMachineLevel = 1;

View File

@ -48,31 +48,31 @@ namespace MyGame.Scripts
normalWindow.SetActive(true);
coinObject.SetActive(true);
messageText.text = ScriptLocalization.System.CoinMainMessage;
SetButtonAction(closeButton, okButton);
SetButtonAction(closeButton, okButton, AdManager.AD_PLACEMENT_COIN);
break;
case RewardType.CornField:
normalWindow.SetActive(true);
fertilizerObject.SetActive(true);
messageText.text = ScriptLocalization.System.CornFieldMessage;
SetButtonAction(closeButton, okButton);
SetButtonAction(closeButton, okButton, AdManager.AD_PLACEMENT_CORNFIELD);
break;
case RewardType.IncreaseCustomer:
normalWindow.SetActive(true);
publicityObject.SetActive(true);
messageText.text = ScriptLocalization.System.IncreaseCustomerMessage;
SetButtonAction(closeButton, okButton);
SetButtonAction(closeButton, okButton, AdManager.AD_PLACEMENT_CUSTOMER);
break;
case RewardType.PerfectPopcorn:
normalWindow.SetActive(true);
messageText.text = ScriptLocalization.System.PerfectPopcornMessage;
SetButtonAction(closeButton, okButton);
SetButtonAction(closeButton, okButton, AdManager.AD_PLACEMENT_PERFECT);
break;
default:
throw new ArgumentOutOfRangeException();
}
}
private void SetButtonAction(Button closeButton, Button okButton)
private void SetButtonAction(Button closeButton, Button okButton, string Placement)
{
closeButton.OnClickAsObservable().Take(1).Subscribe(_ =>
{
@ -96,7 +96,7 @@ namespace MyGame.Scripts
LocalCacheManager.Remove(OkCallbackTag);
}
TransitionManager.Instance.UnloadScene(GameScenes.WatchMovieCoin);
});
}, Placement);
}
else
{

View File

@ -32,8 +32,8 @@ MonoBehaviour:
- d078eab3b8d4a6b44ccfb7d9258a8e0bddad1337
- 41e0f225a9f8751a3fc893cae6eb933df7d0214e
Build:
- 1.0.1
- 1.0.0
- 1.1.0
- 1.1.0
SelectedPlatformOrganization:
- usaya
- usaya
@ -174,7 +174,6 @@ MonoBehaviour:
VerboseLogBuild: 0
UseManualSessionHandling: 0
SendExampleGameDataToMyGame: 0
UseIMEI: 0
InternetConnectivity: 0
CustomDimensions01: []
CustomDimensions02: []