我想计算两个 System.Numerics.Vector3 之间的角度,但我找不到任何函数。Google 仅查找 2d 点的结果。我想在c#中实现这个。
我\xc2\xb4m 试图在Unity 的游戏中编写一个功能,允许玩家回到5 秒前的位置,所以我希望每5 秒,保存玩家\xc2\xb4s 坐标以返回到如果您按下某个键,则会显示它们。
\n\n我唯一不知道的就是与时间有关的一切。我看到了使用计时器的指南,但我不明白\xc2\xb4到底是什么,有人可以帮忙吗?
\n我正在尝试使用“包含”方法提取与子字符串匹配的文件名。但是,回报似乎是List<char>但我期望List<string>。
private void readAllAttribues()
{
using (var reader = new StreamReader(attribute_file))
{
//List<string> AllLines = new List<string>();
List<FileNameAttributeList> AllAttributes = new List<FileNameAttributeList>();
while (!reader.EndOfStream)
{
FileNameAttributeList Attributes = new FileNameAttributeList();
Attributes ImageAttributes = new Attributes();
Point XY = new Point();
string lineItem = reader.ReadLine();
//AllLines.Add(lineItem);
var values = lineItem.Split(',');
Attributes.ImageFileName = values[1];
XY.X = Convert.ToInt16(values[3]);
XY.Y = Convert.ToInt16(values[4]);
ImageAttributes.Location = XY;
ImageAttributes.Radius = Convert.ToInt16(values[5]);
ImageAttributes.Area = Convert.ToInt16(values[6]);
AllAttributes.Add(Attributes);
}
List<string> unique_raw_filenames = AllAttributes.Where(x => x.ImageFileName.Contains(@"non")).FirstOrDefault().ImageFileName.ToList();
List<string>var …Run Code Online (Sandbox Code Playgroud)