Created
November 12, 2018 06:21
-
-
Save ikoan310/c778b03f9501362d441e35532b00f8e3 to your computer and use it in GitHub Desktop.
Create ScriptableObject Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Sample() | |
{ | |
string[] csv = File.ReadAllLines("PATH"); | |
// read line | |
for(int n=0 ; n<csv.Length ; n++) | |
{ | |
// create scriptable object | |
SampleScriptableObject scObject = CreateInstance<SampleScriptableObject>(); | |
string[] datas = csv[n].Split(','); | |
scObject.hoge = int.Parse(datas[0]); | |
// save scriptable object | |
AssetDatabase.CreateAsset(scObject, "<Path>.asset"); | |
AssetDatabase.Refresh(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment