/// <summary>
 /// Configures the action used to control grabbing.
 /// </summary>
 public virtual void ConfigureGrabAction()
 {
     if (GrabAction != null && Facade != null && Facade.GrabAction != null)
     {
         GrabAction.RunWhenActiveAndEnabled(() => GrabAction.ClearSources());
         GrabAction.RunWhenActiveAndEnabled(() => GrabAction.AddSource(Facade.GrabAction));
     }
 }
Example #2
0
 // Start is called before the first frame update
 void Start()
 {
     m_SpriteRenderer = GetComponent <SpriteRenderer>();
     m_Rigidbody      = GetComponent <Rigidbody2D>();
     m_SoundManager   = GetComponent <SoundManager>();
     m_Grabber        = GetComponent <GrabAction>();
     m_bJumpIsPressed = false;
     m_iNumJumps      = m_iMaxJumps;
 }
Example #3
0
    // Start is called before the first frame update
    void Start()
    {
        m_MagpieAnim  = GetComponent <Animator>();
        m_Rigidbody2D = GetComponent <Rigidbody2D>();
        m_Grabber     = GetComponent <GrabAction>();

        m_MagpieAnim.SetBool("InAir", false);
        m_MagpieAnim.SetBool("Moving", false);
        m_MagpieAnim.SetBool("Carrying", false);
    }
 /// <summary>
 /// Processes the given collision data into a grab action based on the given state.
 /// </summary>
 /// <param name="publisher">The collision data to process.</param>
 /// <param name="actionState">The grab state to check against.</param>
 protected virtual void ProcessGrabAction(ActiveCollisionPublisher publisher, bool actionState)
 {
     InstantGrabProcessor.SetActive(false);
     PrecognitionGrabProcessor.SetActive(false);
     if (GrabAction.Value != actionState)
     {
         GrabAction.Receive(actionState);
     }
     if (GrabAction.Value)
     {
         publisher.Publish();
     }
     ChooseGrabProcessor();
 }
Example #5
0
 public void SetGrabber(GrabAction grabScript)
 {
     m_GrabberScript = grabScript;
 }