|
Post by torres on Jun 17, 2022 5:27:47 GMT
Hello, I use SimpleSQL - v2.14.1 I've used the 'select' query as below as per the manual, but the value comes out as 0. (Actually, the value is stored as '1.0') Why read this is '0'? private readonly SimpleSQLManager _dbManager = GameObject.Find( "DB Manager" ).GetComponent<SimpleSQLManager>(); private static string TableNameGyro = "GyroIngredient";
public List< float > GetListGyroYaw() { string sql = "SELECT Yaw FROM " + TableNameGyro;
List< float > tempDataYaw = _dbManager.Query< float >( sql ); foreach( var data in tempDataYaw ) { Debug.Log( "yaw: " + data ); }
return tempDataYaw; }
public class GyroIngredient { [PrimaryKey] [AutoIncrement] [NotNull] public int ID { get; set; } [NotNull] public float Yaw { get; set; } [NotNull] public float Pitch { get; set; } [NotNull] public float Roll { get; set; }
[Ignore] public static Vector3 ToVector3( GyroIngredient ing ) { return new Vector3( ing.Yaw, ing.Pitch, ing.Roll ); }
[Ignore] public static GyroIngredient ToGyroIngredient( Vector3 ing ) { return new GyroIngredient { // TODO: Check if right matched value. Yaw = ing.x, Pitch = ing.y, Roll = ing.z }; } }
|
|
|
Post by echo17 on Jun 17, 2022 14:13:35 GMT
Sounds like this FAQ will help: link
|
|