playMaker

Author Topic: Taking a look at ByteBrew's implementation  (Read 261 times)

Broken Stylus

  • Beta Group
  • Hero Member
  • *
  • Posts: 716
Taking a look at ByteBrew's implementation
« on: August 04, 2022, 07:28:15 AM »
ByteBrew is a new analytics tools suite that is similar to Game Analytics.
I'm looking into their documentation and the tutorials for Unity.

I've got an initializer below;

Code: [Select]
using UnityEngine;
using ByteBrewSDK;
//Broken Stylus 2022

namespace HutongGames.PlayMaker.Actions
{
[ActionCategory("ByteBrew")]
[Tooltip("Initializes the ByteBrew SDK.")]
public class ByteBrewInitialize : FsmStateAction
{
        // Code that runs on entering the state.
        public override void OnEnter()
        {
            // Initialize ByteBrew
            ByteBrew.InitializeByteBrew();
            Finish();
            //Debug.Log("ByteBrew Initialized");
        }
}
}

However the other functions require more elaborate code obviously. For example, when it comes to collecting data about IAPs and their receipts and sending it to the Dashboard.
That whole piece of code seen in the video would need to be made slightly more dynamic, for example to replace references to item category, "CoinPack" here, with an FsmString. There is some regional code too.
The publisher doesn't provide code samples unfortunately.
Now there are two options to do this I think. This demonstrated script is called an IAPmanager but it would be preferable to have the action be called an IAP tracker, especially if option 2 is chosen.

  • Either copy paste all the code there and modify it to make behave like a Playmaker action and remove the unnecessary stuff, such as the initialization of UnityPurchasing that should be done in an action dedicated to managing Unity's IAP SDK.
  • Or create two scripts, a PM one that's simpler and lighter and another classic script that contains most of the code and will be called by the PM action.

I also contacted ByteBrew for some input on this but didn't get any answer yet, perhaps because of the summer break period.