简单的Unity全局弹窗方式
编辑
105
2022-03-27
简单的Unity全局弹窗方式
Unity版本2020.3.27f
资源使用方式
- 直接克隆该项目
- 导入unitypackage包
使用方法
显示弹窗
PopupWindowControl.Instance.AccordingToPopupWindow(new PopupWindowControl.CC_PopupWindow()
{
Title = new PopupWindowControl.CC_Title()
{
TitleColor = new Color(1.0f,0.5f,0.5f,1.0f),
TitleText = "示例标题",
TitleTextColor = Color.white
},
Body = new PopupWindowControl.CC_Body()
{
BodyColor = new Color(1.0f,0.5f,0.5f,1.0f),
BodyText = "示例内容",
BodyTextColor = Color.white
},
Buttons = new List<PopupWindowControl.CC_Button>()
{
new PopupWindowControl.CC_Button()
{
ButtonColor =new Color(1.0f,0.5f,0.5f,1.0f),
ButtonText = "确定",
ButtonTextColor = Color.white,
CallBack = (g =>
{
Debug.Log("按下按钮");
PopupWindowControl.Instance.ClosePopupWindow(g);
})
},
new PopupWindowControl.CC_Button()
{
ButtonColor = Color.gray,
ButtonText = "取消",
ButtonTextColor = Color.white,
CallBack = (g =>
{
Debug.Log("按下按钮");
PopupWindowControl.Instance.ClosePopupWindow(g);
})
}
}
});
关闭弹窗
PopupWindowControl.Instance.ClosePopupWindow(g);
演示视频
您的浏览器不支持播放该视频!
- 0
- 0
-
分享