com.typhoon.unitysdk 1.0.42 → 1.0.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -89,6 +89,7 @@ namespace TyphoonUnitySDK
89
89
 
90
90
  match.Apply(setting);
91
91
  InvokeOnApplyEnd(setting);
92
+ Debug.Log($"<color=#3ac9f3>想在应用前or后做点事情?任意Editor文件夹下创建class继承TyphoonUnitySDK.OnApplyProcessor实现接口</color>");
92
93
  }
93
94
  }
94
95
 
@@ -70,6 +70,11 @@ namespace TyphoonUnitySDK
70
70
  /// </summary>
71
71
  public static readonly string APPLY_HISTORY = ".typhoon/typhoon_sdk_apply_history.txt";
72
72
 
73
+ /// <summary>
74
+ /// 说明文档
75
+ /// </summary>
76
+ public static string DOC_URL = "https://auffm1e1gb.feishu.cn/docx/QiGldaOsWom8p4xGjchcTpm5nmh";
77
+
73
78
 
74
79
  /// <summary>
75
80
  /// 获取windows用户名文件夹
@@ -683,17 +688,6 @@ namespace TyphoonUnitySDK
683
688
  return result.ToArray();
684
689
  }
685
690
 
686
- // /// <summary>
687
- // /// 执行批处理
688
- // /// </summary>
689
- // public static void RunBat(string path, string args = "", Action complete = null)
690
- // {
691
- // using (var process = Process.Start("explorer", $"\"{Path.GetFullPath(path)}\" {args}"))
692
- // {
693
- // }
694
- //
695
- // }
696
-
697
691
 
698
692
  /// <summary>
699
693
  /// 执行批处理
@@ -758,5 +752,31 @@ namespace TyphoonUnitySDK
758
752
  Alphaleonis.Win32.Filesystem.File.Delete(path, true);
759
753
  }
760
754
  }
755
+
756
+
757
+ [MenuItem("TyphoonSDK/说明文档", priority = -10000)]
758
+ public static void OpenDoc()
759
+ {
760
+ Application.OpenURL(DOC_URL);
761
+ }
762
+
763
+
764
+ [MenuItem("TyphoonSDK/打开.typhoonoutput", priority = -10000)]
765
+ public static void OpenOutPutFolder()
766
+ {
767
+ var file = $".typhoonoutput/.md";
768
+ if (!File.Exists(file))
769
+ {
770
+ var dir = Path.GetDirectoryName(file);
771
+ if (!Directory.Exists(dir))
772
+ {
773
+ Directory.CreateDirectory(dir);
774
+ }
775
+
776
+ File.WriteAllText(file, "");
777
+ }
778
+
779
+ EditorUtility.RevealInFinder(file);
780
+ }
761
781
  }
762
782
  }
@@ -65,7 +65,7 @@ namespace TyphoonUnitySDK
65
65
  }
66
66
 
67
67
  /*隐藏banner*/
68
- public virtual void HideBanner(string scene)
68
+ public virtual void HideBanner(string scene = "")
69
69
  {
70
70
  }
71
71
 
@@ -194,7 +194,13 @@ namespace TyphoonUnitySDK
194
194
 
195
195
  #region 侧边栏复访(抖音小游戏)
196
196
 
197
- public virtual void IsSupportSideBar(Action success, Action<string> fail)
197
+ public virtual bool IsSupportSideBar()
198
+ {
199
+ //默认不支持
200
+ return false;
201
+ }
202
+
203
+ public virtual void CheckSideBarSupportFlag(Action success, Action<string> fail)
198
204
  {
199
205
  //默认不支持
200
206
  fail?.Invoke("no support in this channel");
@@ -155,8 +155,11 @@ namespace TyphoonUnitySDK
155
155
  /// </summary>
156
156
  public interface ISideBarReturn
157
157
  {
158
- //是都支持侧边栏
159
- void IsSupportSideBar(Action success, Action<string> fail);
158
+ //是否支持侧边栏
159
+ bool IsSupportSideBar();
160
+
161
+ //检查侧边栏支持flag
162
+ void CheckSideBarSupportFlag(Action success, Action<string> fail);
160
163
 
161
164
  //导航到侧边栏
162
165
  void NavigateToSideBar(Action success, Action<string> fail);
@@ -204,7 +204,7 @@ namespace TyphoonUnitySDK
204
204
  /// <param name="scene">广告场景</param>
205
205
  /// <param name="success">成功回调,发放奖励</param>
206
206
  /// <param name="fail">失败回调,返回失败原因</param>
207
- public void ShowVideo(string scene, Action success, Action<string> fail)
207
+ public void ShowVideo(string scene, Action success, Action<string> fail = null)
208
208
  {
209
209
  Log($"ShowVideo:{scene}");
210
210
  #if UNITY_EDITOR
@@ -280,8 +280,8 @@ namespace TyphoonUnitySDK
280
280
  /// <summary>
281
281
  /// 隐藏banner
282
282
  /// </summary>
283
- /// <param name="scene"></param>
284
- public void HideBanner(string scene)
283
+ /// <param name="scene">暂不作用,可以不传</param>
284
+ public void HideBanner(string scene = "")
285
285
  {
286
286
  #if UNITY_EDITOR
287
287
  if (SdkTestInUnity.Instance.OpenInteractive)
@@ -625,11 +625,32 @@ namespace TyphoonUnitySDK
625
625
  #region 侧边栏(抖音小游戏)
626
626
 
627
627
  /// <summary>
628
- /// 判断是否支持侧边栏,可以通过此接口判断是否开启侧边栏奖励入口
628
+ /// 判断是否支持侧边栏功能,可以通过此接口判断是否开启侧边栏相关UI,请在登录完成后再调用
629
+ /// </summary>
630
+ public virtual bool IsSupportSideBar()
631
+ {
632
+ #if UNITY_EDITOR
633
+ switch (AppConfig.Channel)
634
+ {
635
+ case AppChannel.DouyinAndroid:
636
+ case AppChannel.DouyinIOS:
637
+ break;
638
+ default:
639
+ return false;
640
+ }
641
+
642
+ return SdkTestInUnity.Instance.IsSupportSideBarResult;
643
+ #endif
644
+ return _sdk.IsSupportSideBar();
645
+ }
646
+
647
+
648
+ /// <summary>
649
+ /// 判断是否支持侧边栏,异步机制
629
650
  /// </summary>
630
651
  /// <param name="success">成功回调,表示支持该功能,可以显示入口</param>
631
652
  /// <param name="fail">失败回调,表示不支持该功能,可以显示入口</param>
632
- public virtual void IsSupportSideBar(Action success, Action<string> fail)
653
+ public virtual void CheckSideBarSupportFlag(Action success, Action<string> fail)
633
654
  {
634
655
  #if UNITY_EDITOR
635
656
  switch (AppConfig.Channel)
@@ -654,7 +675,7 @@ namespace TyphoonUnitySDK
654
675
 
655
676
  return;
656
677
  #endif
657
- _sdk.IsSupportSideBar(success, fail);
678
+ _sdk.CheckSideBarSupportFlag(success, fail);
658
679
  }
659
680
 
660
681
  /// <summary>
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"com.typhoon.unitysdk","displayName":"typhoon unity sdk","version":"1.0.42","description":"","unity":"2018.1","type":"tool","hideInEditor":false,"author":{"name":"Jan Zhang","email":"","url":""},"changelogUrl":"","documentationUrl":"","keywords":["typhoon"],"license":"","licensesUrl":"","customDependencies":[{"PackageName":"com.unity.nuget.newtonsoft-json","Value":"2.0.0"}],"dependencies":{"com.unity.nuget.newtonsoft-json":"2.0.0"}}
1
+ {"name":"com.typhoon.unitysdk","displayName":"typhoon unity sdk","version":"1.0.43","description":"","unity":"2018.1","type":"tool","hideInEditor":false,"author":{"name":"Jan Zhang","email":"","url":""},"changelogUrl":"","documentationUrl":"","keywords":["typhoon"],"license":"","licensesUrl":"","customDependencies":[{"PackageName":"com.unity.nuget.newtonsoft-json","Value":"2.0.0"}],"dependencies":{"com.unity.nuget.newtonsoft-json":"2.0.0"}}