playMaker

Author Topic: Add a ErrorCheck in "EnableBehaviour" Action  (Read 2819 times)

idleman

  • Playmaker Newbie
  • *
  • Posts: 7
Add a ErrorCheck in "EnableBehaviour" Action
« on: December 12, 2012, 05:42:49 AM »
Every time I change my component name, it may be a heavy work to do check all "EnableBehaviour" action in all scenes. So I write a ErrorCheck().

Quote
      public override string ErrorCheck() {         
         GameObject go = Fsm.GetOwnerDefaultTarget(gameObject);
         
         if( go == null )
            return null;
         
         if( component != null )
            return null;
         
         if( behaviour.IsNone || string.IsNullOrEmpty(behaviour.Value) )
            return null;
         
         Behaviour comp = go.GetComponent(behaviour.Value) as Behaviour;
         
         if( comp != null )
            return null;
         
         return "Behaviour missing";
      }

Can it be added to the official version?

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: Add a ErrorCheck in "EnableBehaviour" Action
« Reply #1 on: April 14, 2013, 04:31:41 PM »
Sorry, I missed this before. It's in the next update...