123 lines
3.6 KiB
C#
123 lines
3.6 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class PanelRecord : BasePanel
|
|
{
|
|
[SerializeField] Button mBtnStartRecord;
|
|
[SerializeField] Button mBtnRecording;
|
|
[SerializeField] Button mBtnShare;
|
|
|
|
private TKGSDKManager.SCLCategory _sclCategory = TKGSDKManager.SCLCategory.None;
|
|
|
|
private void Awake()
|
|
{
|
|
#if H5_WX
|
|
gameObject.SetActive(false);
|
|
#elif H5_DY
|
|
//string platform = StarkSDK.API.GetSystemInfo().platform;
|
|
//if (platform != null && platform.ToLower().Contains("ios"))
|
|
//{
|
|
// gameObject.SetActive(false);
|
|
//}
|
|
//Debug.Log("SYSTEM INFO : " + platform);
|
|
#endif
|
|
Debug.Log("HC SHARE OR RECORD BTN");
|
|
gameObject.SetActive(true);
|
|
mBtnStartRecord.gameObject.SetActive(true);
|
|
mBtnRecording.gameObject.SetActive(false);
|
|
mBtnShare.gameObject.SetActive(false);
|
|
|
|
UIUtils.BindBtn(mBtnStartRecord, OnStartRecord);
|
|
UIUtils.BindBtn(mBtnRecording, OnRecording);
|
|
UIUtils.BindBtn(mBtnShare, OnShare);
|
|
}
|
|
|
|
private void OnStartRecord()
|
|
{
|
|
Debug.Log("OnStartRecord ----- ");
|
|
OnClickShareGame();
|
|
}
|
|
|
|
private void OnRecording()
|
|
{
|
|
Debug.Log("OnRecording ----- ");
|
|
OnClickShareGame();
|
|
}
|
|
|
|
private void OnShare()
|
|
{
|
|
Debug.Log("OnShare ----- ");
|
|
OnClickShareGame();
|
|
}
|
|
|
|
private void OnClickShareGame()
|
|
{
|
|
Debug.Log("PanelGame - OnClickShareGame");
|
|
|
|
_sclCategory = GetSclCategoryState(_sclCategory);
|
|
Debug.Log("OnClickShareGame, _sclCategory : " + _sclCategory);
|
|
|
|
TKGSDKManager.Instance.ScreenRecordingLogic(_sclCategory, "share title", new List<string>() { "尖叫吧小鸡仔" }, () =>
|
|
{
|
|
Debug.Log("分享结束 ----");
|
|
});
|
|
RefershUI();
|
|
|
|
}
|
|
|
|
private TKGSDKManager.SCLCategory GetSclCategoryState(TKGSDKManager.SCLCategory _sclCategory)
|
|
{
|
|
mBtnStartRecord.gameObject.SetActive(false);
|
|
mBtnRecording.gameObject.SetActive(false);
|
|
mBtnShare.gameObject.SetActive(false);
|
|
|
|
TKGSDKManager.SCLCategory tempCategory = _sclCategory;
|
|
Debug.Log("tempCategory : " + tempCategory);
|
|
if (tempCategory == TKGSDKManager.SCLCategory.None)
|
|
{
|
|
tempCategory = TKGSDKManager.SCLCategory.开始;
|
|
}
|
|
else if (tempCategory == TKGSDKManager.SCLCategory.开始)
|
|
{
|
|
tempCategory = TKGSDKManager.SCLCategory.结束;
|
|
}
|
|
else if (tempCategory == TKGSDKManager.SCLCategory.结束)
|
|
{
|
|
tempCategory = TKGSDKManager.SCLCategory.分享;
|
|
}
|
|
else if (tempCategory == TKGSDKManager.SCLCategory.分享)
|
|
{
|
|
tempCategory = TKGSDKManager.SCLCategory.开始;
|
|
}
|
|
return tempCategory;
|
|
}
|
|
|
|
private void RefershUI()
|
|
{
|
|
mBtnStartRecord.gameObject.SetActive(false);
|
|
mBtnRecording.gameObject.SetActive(false);
|
|
mBtnShare.gameObject.SetActive(false);
|
|
|
|
Debug.Log("RefershUI _sclCategory : " + _sclCategory);
|
|
if (_sclCategory == TKGSDKManager.SCLCategory.None)
|
|
{
|
|
mBtnStartRecord.gameObject.SetActive(true);
|
|
}
|
|
else if (_sclCategory == TKGSDKManager.SCLCategory.开始)
|
|
{
|
|
mBtnRecording.gameObject.SetActive(true);
|
|
}
|
|
else if (_sclCategory == TKGSDKManager.SCLCategory.结束)
|
|
{
|
|
mBtnShare.gameObject.SetActive(true);
|
|
}
|
|
else if (_sclCategory == TKGSDKManager.SCLCategory.分享)
|
|
{
|
|
mBtnStartRecord.gameObject.SetActive(true);
|
|
}
|
|
}
|
|
|
|
}
|