ArgumentException: Name has invalid chars
System.IO.FileStream…ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.IO/FileStream.cs:253)
That is the error message, which occurs when I run an editor script I made HERE:
using UnityEngine;
using UnityEditor;
using System.IO;
using System.Text;
using System;
public class SplitPage : ScriptableWizard {
public TextAsset asset;
public TextAsset names;
public string[] named = new string[151];
public string[] sliced;
public string path;
public string fileName = ".txt";
[MenuItem("GameObject/SlicePage")]
static void CreateWizard() {
ScriptableWizard.DisplayWizard<SplitPage>("Split Text File", "Create");
}
void OnWizardCreate() {
named = names.text.Split ('
‘);
sliced = asset.text.Split (’
');
for (int i = 0; i < sliced.Length; i++) {
path = @“C:\Users\Jonathan\Documents\Pokemon Data"+named*+”.txt";*
-
using(StreamWriter w = new StreamWriter(path)) {*
_ w.WriteLine(sliced*);_
_ }_
_ }_
_ }_
_}*_
Not the slightest idea why. Every time I ran it to the path Application.dataPath it worked, but would say its blocked from access.