mirror of
https://github.com/babalae/better-genshin-impact.git
synced 2026-04-26 22:39:47 +08:00
57 lines
1.7 KiB
C#
57 lines
1.7 KiB
C#
using System.Collections.Generic;
|
|
using BetterGenshinImpact.Core.Recognition;
|
|
using OpenCvSharp;
|
|
|
|
namespace BetterGenshinImpact.GameTask.Common.Element.Assets;
|
|
|
|
public class ElementAssets
|
|
{
|
|
public RecognitionObject BtnWhiteConfirm;
|
|
public RecognitionObject BtnWhiteCancel;
|
|
public RecognitionObject BtnBlackConfirm;
|
|
|
|
private ElementAssets()
|
|
{
|
|
var info = TaskContext.Instance().SystemInfo;
|
|
|
|
// 按钮
|
|
BtnWhiteConfirm = new RecognitionObject
|
|
{
|
|
Name = "BtnWhiteConfirm",
|
|
RecognitionType = RecognitionTypes.TemplateMatch,
|
|
TemplateImageMat = GameTaskManager.LoadAssetImage(@"Common\Element", "btn_white_confirm.png"),
|
|
DrawOnWindow = false
|
|
}.InitTemplate();
|
|
BtnWhiteCancel = new RecognitionObject
|
|
{
|
|
Name = "BtnWhiteCancel",
|
|
RecognitionType = RecognitionTypes.TemplateMatch,
|
|
TemplateImageMat = GameTaskManager.LoadAssetImage(@"Common\Element", "btn_white_cancel.png"),
|
|
DrawOnWindow = false
|
|
}.InitTemplate();
|
|
BtnBlackConfirm = new RecognitionObject
|
|
{
|
|
Name = "BtnBlackConfirm",
|
|
RecognitionType = RecognitionTypes.TemplateMatch,
|
|
TemplateImageMat = GameTaskManager.LoadAssetImage(@"Common\Element", "btn_black_confirm.png"),
|
|
DrawOnWindow = false
|
|
}.InitTemplate();
|
|
|
|
}
|
|
|
|
|
|
private static ElementAssets? _uniqueInstance;
|
|
private static readonly object Locker = new();
|
|
|
|
public static ElementAssets Instance()
|
|
{
|
|
if (_uniqueInstance == null)
|
|
{
|
|
lock (Locker)
|
|
{
|
|
_uniqueInstance ??= new ElementAssets();
|
|
}
|
|
}
|
|
return _uniqueInstance;
|
|
}
|
|
} |