Esempio n. 1
0
 public void AddEventHandlerComponents()
 {
     if (!PlayMakerGlobals.IsEditor)
     {
         Debug.Log("FSM not Preprocessed: " + SkillUtility.GetFullFsmLabel(this.fsm));
     }
     if (this.fsm.MouseEvents)
     {
         this.AddEventHandlerComponent <PlayMakerMouseEvents>(2);
     }
     if (this.fsm.HandleCollisionEnter)
     {
         this.AddEventHandlerComponent <PlayMakerCollisionEnter>(2);
     }
     if (this.fsm.HandleCollisionExit)
     {
         this.AddEventHandlerComponent <PlayMakerCollisionExit>(2);
     }
     if (this.fsm.HandleCollisionStay)
     {
         this.AddEventHandlerComponent <PlayMakerCollisionStay>(2);
     }
     if (this.fsm.HandleTriggerEnter)
     {
         this.AddEventHandlerComponent <PlayMakerTriggerEnter>(2);
     }
     if (this.fsm.HandleTriggerExit)
     {
         this.AddEventHandlerComponent <PlayMakerTriggerExit>(2);
     }
     if (this.fsm.HandleTriggerStay)
     {
         this.AddEventHandlerComponent <PlayMakerTriggerStay>(2);
     }
     if (this.fsm.HandleCollisionEnter2D)
     {
         this.AddEventHandlerComponent <PlayMakerCollisionEnter2D>(2);
     }
     if (this.fsm.HandleCollisionExit2D)
     {
         this.AddEventHandlerComponent <PlayMakerCollisionExit2D>(2);
     }
     if (this.fsm.HandleCollisionStay2D)
     {
         this.AddEventHandlerComponent <PlayMakerCollisionStay2D>(2);
     }
     if (this.fsm.HandleTriggerEnter2D)
     {
         this.AddEventHandlerComponent <PlayMakerTriggerEnter2D>(2);
     }
     if (this.fsm.HandleTriggerExit2D)
     {
         this.AddEventHandlerComponent <PlayMakerTriggerExit2D>(2);
     }
     if (this.fsm.HandleTriggerStay2D)
     {
         this.AddEventHandlerComponent <PlayMakerTriggerStay2D>(2);
     }
     if (this.fsm.HandleParticleCollision)
     {
         this.AddEventHandlerComponent <PlayMakerParticleCollision>(2);
     }
     if (this.fsm.HandleControllerColliderHit)
     {
         this.AddEventHandlerComponent <PlayMakerControllerColliderHit>(2);
     }
     if (this.fsm.HandleJointBreak)
     {
         this.AddEventHandlerComponent <PlayMakerJointBreak>(2);
     }
     if (this.fsm.HandleJointBreak2D)
     {
         this.AddEventHandlerComponent <PlayMakerJointBreak>(2);
     }
     if (this.fsm.HandleFixedUpdate)
     {
         this.AddEventHandlerComponent <PlayMakerFixedUpdate>(2);
     }
     if (this.fsm.HandleOnGUI && base.GetComponent <PlayMakerOnGUI>() == null)
     {
         PlayMakerOnGUI playMakerOnGUI = base.get_gameObject().AddComponent <PlayMakerOnGUI>();
         playMakerOnGUI.playMakerFSM = this;
     }
     if (this.fsm.HandleApplicationEvents)
     {
         this.AddEventHandlerComponent <PlayMakerApplicationEvents>(2);
     }
     if (this.fsm.HandleAnimatorMove)
     {
         this.AddEventHandlerComponent <PlayMakerAnimatorMove>(2);
     }
     if (this.fsm.HandleAnimatorIK)
     {
         this.AddEventHandlerComponent <PlayMakerAnimatorIK>(2);
     }
     this.eventHandlerComponentsAdded = true;
 }