c# - c#中浮点数数组的定义
问题描述
我有一个数组在它被定义为双精度时起作用。当我将它们传递给 Vector3(用于 Unity 中的某些用途)时,它们需要定义为浮点数,我在定义时似乎无法做到这一点。我究竟做错了什么?
private float[] coords_x = { -13.3, -48.2, -53.3, -68, -74, -78.9, -79.1, -72.7 };
private float[] coords_y = { -54.8, -78.3, -81.7, -82, -76.9, -69.2, -54.4, -40.8 };
private float[] coords_theta = { 124, 124, 115, 96, 50, 0, -25.3, -25.3 };
错误:无法将“double”隐式转换为“float”。存在显式转换(您是否缺少演员表)?
解决方案
推荐阅读
- visual-studio - VS Android App (Xamarin) Navigation Drawer App - 添加活动
- javascript - 在更改其属性后重新渲染子类织物对象
- firebase-realtime-database - Spock 测试方法是否被构造函数调用
- node.js - 如何从 Visual Studio 代码中调试 child_process fork 进程
- swift - Swift 中 SKShader 动画的 SpriteKit 问题
- python - 避免使用 odeint 的不同解决方案?拍摄方法
- amazon-web-services - 亚马逊网络服务地理冗余
- powershell - start-process powershell 运行另一个 powershell 来运行另一个带参数的程序。不适用于 args,但适用于 args
- c# - 面部检测和识别代码在 Emgu CV 的 C# 中不起作用
- javascript - 用于导入用户帐户联系人的 Salesforce API