更新了网络服务接口定义

This commit is contained in:
CortexCore
2023-06-07 02:02:14 +08:00
parent 08b05f8a74
commit b2444fd909
2727 changed files with 20455 additions and 4448 deletions

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 38cc9d14a87ac7d44a174a011663463d
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,17 @@
{
"name": "BITKit.Camera",
"rootNamespace": "",
"references": [
"GUID:14fe60d984bf9f84eac55c6ea033a8f4",
"GUID:be17a8778dbfe454890ed8279279e153"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 6c5bd1d06c6446b4695026e1a418b39d
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,48 @@
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using Cysharp.Threading.Tasks;
using UnityEngine.UI;
using UnityEngine.Windows.WebCam;
namespace BITKit
{
public class CameraProvider : MonoBehaviour
{
[SerializeField] private string cameraName;
[SerializeField] private RenderTexture cameraTexture;
[SerializeField] private RawImage rawImage;
// Start is called before the first frame update
async void Start()
{
await Application.RequestUserAuthorization(UserAuthorization.WebCam);
if (Application.HasUserAuthorization(UserAuthorization.WebCam))
{
WebCamDevice[] devices = WebCamTexture.devices;//获取可用设备
if (WebCamTexture.devices.Length <= 0)
{
Debug.LogError("没有摄像头设备,请检查");
return;
}
BIT4Log.Log<CameraProvider>($"已获取到摄像头:{string.Join(" and ",devices.Select(x=>x.name))}");
string devicename =string.IsNullOrEmpty(cameraName) ? devices.First().name : cameraName;
var webCamTexture = new WebCamTexture(devicename, 256, 256, 30)
{
wrapMode = TextureWrapMode.Repeat
};
rawImage.texture = webCamTexture;
webCamTexture.Play();
}
else
{
BIT4Log.Warnning<CameraProvider>("未获取到WebCam授权");
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 39199264603eb804ea156954fe0f50ed
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: