playMaker

Author Topic: ScritpableObject?[SOLVED]  (Read 2506 times)

cwmanley

  • Full Member
  • ***
  • Posts: 107
ScritpableObject?[SOLVED]
« on: June 02, 2016, 08:31:25 PM »
Hi,

Is there a way to reference a Scriptable Object from a public FsmObject variable.

Thanks

« Last Edit: June 03, 2016, 12:27:56 AM by cwmanley »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: ScritpableObject?
« Reply #1 on: June 02, 2016, 09:34:37 PM »
Use the ObjectTypeAttribute:

Code: [Select]
    [ObjectType(typeof(ScriptableObject))]
    public FsmObject myScriptableObject;

Is that what you mean?

cwmanley

  • Full Member
  • ***
  • Posts: 107
Re: ScritpableObject?
« Reply #2 on: June 02, 2016, 11:06:07 PM »
Hello,

When I use the FsmObject I run into trouble. I am not sure how to get the Scriptable Object class from the FsmObject Variable. Normally I would just get the component but that did not seem to work.

Code: [Select]
//Variable
ScriptableObject.characterName = nameToStore.Value;

//FSM Variable
myScriptableObject.value?

Thanks

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: ScritpableObject?
« Reply #3 on: June 02, 2016, 11:31:24 PM »
Sorry should have mentioned this previously: Use the specific class derived from ScriptableObject. E.g., if MyGameData derives from ScriptableObject use [ObjectType(typeof(MyGameData))]

You can then access the fields/properties/methods specific to that class.

cwmanley

  • Full Member
  • ***
  • Posts: 107
Re: ScritpableObject?
« Reply #4 on: June 03, 2016, 12:27:27 AM »
Thank You :)