该项目的目的是同时测试和演示来自 Unity DOTS 技术堆栈的多个新包。
您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 

39 行
1.0 KiB

using System;
#if UNITY_EDITOR
using System.Collections.Generic;
using System.Globalization;
using System.Reflection;
using Unity.NetCode;
#endif
public class GhostAngleValueAttribute : Attribute
{
}
#if UNITY_EDITOR
class GhostSnapshotValueAngle : GhostSnapshotValue
{
public override void AddImports(HashSet<string> imports)
{
imports.Add("UnityEngine");
}
public override bool SupportsQuantization => true;
public override bool CanProcess(FieldInfo field, string componentName, string fieldName)
{
return field.FieldType == typeof(float) && field.GetCustomAttribute<GhostAngleValueAttribute>() != null;
}
public override bool CanProcess(Type type, string componentName, string fieldName)
{
throw new NotImplementedException();
}
public override string GetTemplatePath(int quantization)
{
if (quantization < 1)
throw new NotImplementedException("Unquantized angle values not supported");
return "Assets/Scripts/Networking/GhostSnapshotValueAngle.txt";
}
}
#endif