using System.Collections; using System.Collections.Generic; using UnityEngine; using TTSDK; using UnityEngine.UI; using System; public class DYSidebarInit : MonoBehaviour { //是否从侧边栏进入:是:点开侧边栏后可以领取奖励;否:跳转到侧边栏 public static bool isEnterFromSidebar = false; [SerializeField] private GameObject sideBar; void Awake() { TT.InitSDK((code, env) => { Debug.Log("入口场景是:" + env.GetLaunchOptionsSync().Scene); //如果不是从侧边栏进入的,去判断当前宿主版本是否支持侧边栏 if (!(env.GetLaunchOptionsSync().Scene == "021036" || env.GetLaunchOptionsSync().Scene == "021001" || env.GetLaunchOptionsSync().Scene == "101036")) { TestSidebar(); } }); TT.GetAppLifeCycle().OnShow += (dir) => { if (dir["location"].ToString() == "sidebar_card" && dir["launchFrom"].ToString() == "homepage") { isEnterFromSidebar = true; } }; GetComponent