This commit is contained in:
CortexCore
2024-03-24 02:05:16 +08:00
parent bfc869d19e
commit 65d90d1bfa
48 changed files with 7433 additions and 7600 deletions

View File

@@ -9,6 +9,6 @@ namespace BITKit
public float Sensitivity = 1.81f;
public float TouchSensitivity = 0.22f;
public float M_Yaw = 0.022f;
public float Fov = 75;
public float Fov = 90;
}
}

View File

@@ -5,7 +5,10 @@ using UnityEngine;
namespace BITKit.Animations
{
public interface IMotionMatchingObject{}
public interface IMotionMatchingObject
{
}
public interface IMotionMatchingService : IObjectMatcher<string,IMotionMatchingObject>
{

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
using BITKit.Mod;
using UnityEngine;
using YooAsset;
@@ -22,23 +23,46 @@ namespace BITKit.Animations
Singleton = this;
}
private void OnEnable()
{
ModService.OnReloaded += Rebuild;
}
private void Start()
{
Rebuild();
}
private void OnDisable()
{
ModService.OnReloaded -= Rebuild;
}
public bool TryMatch(out IMotionMatchingObject value, string[] key)
{
if (_objects.TryMatch(out value, key))
{
return true;
}
BIT4Log.Log<ScriptableMotionMatchingService>($"找不到对应的MotionMatchingObject:{string.Join(",", key)}");
return false;
}
private void Rebuild()
{
var list = new List<ScriptableMotionMatchingObject>();
var tags = new []{nameof(IMotionMatchingObject)};
foreach (var x in YooAssets.GetAssetInfos(tags))
{
var assetHandle =YooAssets.LoadAssetSync<ScriptableMotionMatchingObject>(x.AssetPath);
assetHandle.WaitForAsyncComplete();
list.Add(assetHandle.AssetObject.As<ScriptableMotionMatchingObject>());
var assetHandle =YooAssets.LoadAssetSync<ScriptableMotionMatchingObject>(x.AssetPath);
assetHandle.WaitForAsyncComplete();
list.Add(assetHandle.AssetObject.As<ScriptableMotionMatchingObject>());
}
_objects = new ObjectMatcher<string, IMotionMatchingObject>
{
list = list.ToArray(),
};
}
public bool TryMatch(out IMotionMatchingObject value, string[] key)=>_objects.TryMatch(out value,key);
}
}