PlayMaker Feedback > Action Requests

Set Enum value via string/index?[SOLVED]

(1/3) > >>

craigz:
Wasn't sure if there currently was a way to do this or not...

I'm looking for a way to save current enum values, and best I can find to do is save the index/int for the enum. But then I realized there's no way to actually SET an enum by any value other than an enum.

Could have an int-switch tied to set-enum but that seems like a bit of a workaround. *shrugs* just wasn't sure if there was a better way?

best,

craigz

jeanfabre:
Hi,

 Good point. Made an action for this on the Ecosystem. Search for "ConvertIntToEnum"



 bye,

 Jean

jeanfabre:
Hi,

 and the second one: ConvertStringToEnum



 Bye,

 Jean

craigz:
BOOM!

As usual Jean, thank you!

You rock :D

-craigz

craigz:
So a follow up question, that I feel you might have answered else, couldnt remember if it was a Unity limitation or not.

But would some sort of a 'FSM Enum Switch' or 'FSM Enum Test' action be possible? (similar to how the FSM Bool Test action tests the bool on another without having to have a local data variable made on the object thats doing the testing)

I find myself needing to test if the enum on other game objects is a certain one. And things have been getting cluttered from making duplicate variables on the manager type gameobject just for the purpose of doing 'Get FSM Enum' then followed by 'Enum Switch' etc :)

-craigz

Navigation

[0] Message Index

[#] Next page

Go to full version