[Unity][Fungus]csvParser.Parse error

 

 

Assets/Fungus/Scripts/Components/Localization.cs(189,45): error CS1061: Type `CsvParser' does not contain a definition for `Parse' and no extension method `Parse' of type `CsvParser' could be found. Are you missing an assembly reference?

Assets/Fungus/Scripts/Components/Localization.cs(382,45): error CS1061: Type `CsvParser' does not contain a definition for `Parse' and no extension method `Parse' of type `CsvParser' could be found. Are you missing an assembly reference?

 


            CsvParser csvParser = new CsvParser();
            string[][] csvTable = csvParser.Parse(localizationFile.text);

打开CsvParser.cs文件,发现有2个同名文件。

发现之前导入了其他的同名的CsvParser.cs文件

 


 

Assets/Fungus/Thirdparty/CSVParser/CsvParser.cs

在这个文件夹中 重新新建了一个CsvParser_Fungus.cs文件

文件位置为Assets/Fungus/Thirdparty/CSVParser/CsvParser_Fungus.cs

Assets/Fungus/Thirdparty/CSVParser/CsvParser.cs

复制粘贴到

Assets/Fungus/Thirdparty/CSVParser/CsvParser_Fungus.cs

把CsvParser_Fungus.cs的名字由(14行)CsvParser更改正确为CsvParser_Fungus

 

在CsvParser_Fungus.cs中

// Copyright 2014 ideafixxxer
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;

namespace Ideafixxxer.CsvParser
{
	public class CsvParser//删除CsvParser,改为CsvParser_Fungus
	{
...

改正后如下所示


// Copyright 2014 ideafixxxer
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;

namespace Ideafixxxer.CsvParser
{
    public class CsvParser_Fungus
...

删除Assets/Fungus/Thirdparty/CSVParser/CsvParser.cs文件,避免重复的同名文件错误调用


 

在Localization.cs中

...
            CsvParser csvParser = new CsvParser();
            string[][] csvTable = csvParser.Parse(localizationFile.text);
...

381、382行和188、189行上面的错误改为下面的代码

...
            CsvParser_Fungus csvParser = new CsvParser_Fungus();
            string[][] csvTable = csvParser.Parse(localizationFile.text);
...

 

 

 

 

 

 

你可能感兴趣的:(Unity,Unity插件#Fungus,#Unity插件Fungus)