playMaker

Author Topic: Cannot destroy texture in playmaker action  (Read 1449 times)

cdutoit

  • Playmaker Newbie
  • *
  • Posts: 28
Cannot destroy texture in playmaker action
« on: October 02, 2015, 09:51:41 PM »
Hi -

I have a playmaker custom action that creates and applies textures.

In a regular c# script, one would call Destroy(_texture) to free up the memory used creating the texture.

However, in a custom playmaker action, the Destroy method is not available to me as that is part of the monobehavior class, not FsmStateAction which is what playmaker actions inherit from.

So, how would I destroy the texture inside a playmaker action?

Thanks
Chris

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4003
  • Official Playmaker Support
    • LinkedIn
Re: Cannot destroy texture in playmaker action
« Reply #1 on: October 02, 2015, 09:56:13 PM »
You should be able to use the static UnityEngine.Object.Destroy method:
http://docs.unity3d.com/ScriptReference/Object.Destroy.html

cdutoit

  • Playmaker Newbie
  • *
  • Posts: 28
Re: Cannot destroy texture in playmaker action
« Reply #2 on: October 02, 2015, 10:03:50 PM »
Great, Thanks!