1
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
@@ -5,7 +5,10 @@ using UnityEngine;
|
||||
|
||||
namespace BITKit.Animations
|
||||
{
|
||||
public interface IMotionMatchingObject{}
|
||||
public interface IMotionMatchingObject
|
||||
{
|
||||
|
||||
}
|
||||
public interface IMotionMatchingService : IObjectMatcher<string,IMotionMatchingObject>
|
||||
{
|
||||
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user