Closed kk3hi3123 closed 5 years ago
Show me what do you do exactly.
OneLine works out of the box and there is no need of any initialization.
And here is the result after I create a new asset.
I am using Unity 2018.2.14f1 and here is the project. TestingProject.zip
Ok, there it is.
Look at the screenshot, at the first property Script
lies None (Mono Script)
, but must be the name of class. This mean that Unity can't properly load your script.
I've looked through your project. The problem is that you named the file Data.cs
, but class inside it is DataAsset
. In Unity file must have the same name as public class incide it (this is suitable for classes which inherit from UnityEngine.Object
, for example MonoBehaviour
's and ScriptableObject
's).
So rename file to DataAsset.cs
and this is the solution.
I close the issue, but If your problem is not solved completely, feel free to reopen it.
P.S. When you send your project to someone, or if you use version control system (like Git or SVN), all you need to store is:
The rest is temporary files that will be regenerated on the other PC.
The OneLine examples work as instruction. But when I copy one of the example code to another .cs file and change its name, the new class does not work. Do I miss something like setting or initialize?