referencing a new brokenstate def in c#, no .Named() method

Started by skullywag, August 03, 2015, 08:58:23 AM

Previous topic - Next topic

skullywag

Anyone know how to do this, there is "BrokenStateDef.named("somename")" for it?
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

Haplo

This should work..
DefDatabase<BrokenStateDef>.Named(...)
But it's from memory, so no promises :)

skullywag

Quote from: Haplo on August 03, 2015, 12:16:05 PM
This should work..
DefDatabase<BrokenStateDef>.Named(...)
But it's from memory, so no promises :)

That.....looks like it would work. Damn you brain why cant you think of sfuff like this....ill report back when ive tried it.
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

skullywag

Yep that was it. Still confused why some defs have this method and some dont. Consistency of code and all that, unless theres a valid reason it doesnt.
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

Haplo

Normally you should find all Def in the DefDatabase :)
NonDef not so much ;)