UnityによるCSVデータテーブルの追加・変更チェック

序文

この一連の CSV データ テーブルを追加、変更、確認するための完全なソリューションはインターネット上にほとんどなく、面倒な環境設定とプラグインのインストールが必要になるか、または大量の面倒なコードが必要になります。したがって、それは継続的な探索とテストによってのみ実現できます。

デモビデオ

CSV データテーブルの追加、変更、チェックを行う Unity のデモンストレーション

デモ写真

ファンクションコード
エフェクトコード

コード部分

//本页CSV文件的增、改、查代码为肖老师原创,如需转载,请通知作者:[email protected]
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Text;
//using System.Data.OleDb;
using UnityEngine;

public class MakeDB : MonoBehaviour
{
   
    
    
    [SerializeField]
    string inputID = "", inputPWD = "", registerID = "", registerPWD = "";//用户登录、注册数据

    string loginIndex = "", loginID = "", loginPWD = "";//成功登录后的暂存信息

    public string freshScore = "";//记录当前用户最新成绩

    string filePath = "";//记录数据表地址

    // Start is called before the first frame update
    void Start()
    {
   
    
    
        //filePath = Application.streamingAssetsPath + "\\BariumMealExamData.csv";//新建StreamingAssets文件夹,并将BariumMealExamData.csv保存到此文件夹。CSV文件可以直接用Excel或WPS打开。请勿随意删改csv表中的预留信息,以防出错。
        filePath=Application.persistentDataPath+"//"+ "BariumMealExamData.csv";//保存在安卓端的地址,即apk安装后的files文件夹中
    }

    // Update is called once per frame
    void Update()
    {
   
    
    
        Register(registerID, registerPWD);//新用户注册
        Login(inputID, inputPWD);//用户登录
        UpdateScore();//更新用户成绩
    }

    //更新用户成绩
    void 

おすすめ

転載: blog.csdn.net/qq_39889893/article/details/129278033