Quantcast
Channel: Questions in topic: "unity3.5"
Viewing all articles
Browse latest Browse all 122

ScriptableObject.CreateInstance Woes - Unity 3.5

$
0
0
I have a type "Triggers.Trigger" that derives from ScriptableObject: namespace Triggers { public class Trigger : ScriptableObject { } } I am trying (and failing) to create new instances of it: (Trigger) ScriptableObject.CreateInstance(Trigger); (Trigger) ScriptableObject.CreateInstance(typeof(Trigger).ToString()); (Trigger) ScriptableObject.CreateInstance(); (Trigger) Trigger.CreateInstance(); results in `Instance of Trigger could not be created because there is no script with that name` (Trigger) Trigger.CreateInstance(); results in `The type arguments for method `UnityEngine.ScriptableObject.CreateInstance()' cannot be inferred from the usage. Try specifying the type arguments explicitly` (Trigger) ScriptableObject.CreateInstance("Trigger"); results in `Instance of Trigger couldn't be created. The the script class needs to derive from ScriptableObject.` Specifically, I have a manager class that has a `List`, and I'm trying to programmatically create them. Why is this failing and what can I do to fix it?

Viewing all articles
Browse latest Browse all 122

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>