unity制作抖音小游戏接入侧边栏复访接口实例
注意"scene" 为 "sidebar",activityId为活动码之前加上是有问题的,实现侧边栏我是直接注释就OK了。给一个按钮挂个跳转脚本。主要参考了官方文档,
给一个按钮挂个跳转脚本


注意"scene" 为 "sidebar",activityId为活动码之前加上是有问题的,实现侧边栏我是直接注释就OK了。
using TTSDK;
  using TTSDK.UNBridgeLib.LitJson;
  using UnityEngine;
public class SidebarRevisitHandler : MonoBehaviour
  {
      private void Start()
      {
          TT.InitSDK((code, env) =>
          {
              Debug.Log("Unity message init sdk callback");
              Debug.Log("Unity message code: " + code);
              Debug.Log("Unity message HostEnum: " + env.m_HostEnum);
          });
      }
      // Start is called before the first frame update
      public void TestSidebar()
      {
          var data = new JsonData
          {
              ["scene"] = "sidebar",
              //["activityId"] = "11111111",
          };
          TT.NavigateToScene(data, () =>
          {
              Debug.Log("navigate to scene success");
          }, () =>
          {
              Debug.Log("navigate to scene complete");
          }, (errCode, errMsg) =>
          {
              Debug.Log($"navigate to scene error, errCode:{errCode}, errMsg:{errMsg}");
          });
      }
  }
主要参考了官方文档,侧边栏_抖音开放平台
更多推荐
 
 




所有评论(0)