蝴蝶不菲
Unity3d连接SQL Server数据库:首先需要把Unity安装路径下的System.Data.dll和Mono.Data.SqliteClient.dll拷贝到当前unity工程的Assets文件夹下,因为之后在脚本中引用的.dll并不是framework提供的。脚本的内容:using UnityEngine;using System;using System.Collections;using System.Data;(这个必须是引用自unity的安装目录下,如果找不到就搜索一下)using System.Data.SqlClient;public class ConnectSQL : MonoBehaviour{// Use this for initializationvoid Start(){string connectionString = "Data Source=XYL-PC;DataBase=Unity;uid=sa;pwd=123456;";SqlConnection con = new SqlConnection();con.ConnectionString = connectionString;con.Open();if (con.State == ConnectionState.Open){print("Connect success!");}else{print("Connect Failure!");}}}