chicken_dy/Assets/Scripts/UI/PanelRecord.cs

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);
}
}
}