Esempio n. 1
0
 private void onPlayerExit(PlayerDetectorBehaviour detector, PlayerInteractBehaviour player)
 {
     if (player.currentCollectble == this)
     {
         player.currentCollectble = null;
     }
 }
 private void onPlayerExit(PlayerDetectorBehaviour detector, PlayerInteractBehaviour player)
 {
     if (player.currentReceiver == this)
     {
         player.currentReceiver = null;
     }
 }
Esempio n. 3
0
 private void OnPlayerEnter(PlayerDetectorBehaviour detec, PlayerInteractBehaviour player)
 {
     if (m_active)
     {
         m_controller.OnDie();
     }
 }
Esempio n. 4
0
 private void onPlayerEnter(PlayerDetectorBehaviour detector, PlayerInteractBehaviour player)
 {
     if (!m_isPlugged && (player.currentCollectble == null || !player.currentCollectble.IsBeingHeld))
     {
         player.currentCollectble = this;
     }
 }
Esempio n. 5
0
 public void OnDrop(PlayerInteractBehaviour player)
 {
     transform.SetParent(null);
     rigidbody.bodyType = RigidbodyType2D.Dynamic;
     player.OnDropItem();
     m_isBeingHeld = false;
 }
Esempio n. 6
0
 public void Drop()
 {
     if (m_currentPlayer != null)
     {
         OnDrop(m_currentPlayer);
     }
     m_currentPlayer = null;
 }
Esempio n. 7
0
 public CollectbleInfo OnCollect(PlayerInteractBehaviour player)
 {
     transform.SetParent(player.transform);
     transform.localPosition   = m_collectbleInfo.localPosition;
     rigidbody.bodyType        = RigidbodyType2D.Kinematic;
     rigidbody.velocity        = Vector2.zero;
     rigidbody.angularVelocity = 0f;
     m_currentPlayer           = player;
     m_isBeingHeld             = true;
     return(CollectbleInfo);
 }
 public void RemoveCollectble(PlayerInteractBehaviour player)
 {
     if (currentCollectble == null)
     {
         return;
     }
     AudioController.Instance.Play(plugAudio, AudioController.SoundType.SoundEffect2D);
     currentCollectble.OnRemovedFromReceiver();
     player.CollectItem(currentCollectble);
     currentCollectble = null;
     renderer.sprite   = inactiveSprite;
     animator.SetTrigger(CHANGE_CAP);
     SetDependentObjectsActive(false);
 }
    private void OnTriggerEnter2D(Collider2D collision)
    {
        PlayerInteractBehaviour player = collision.GetComponent <PlayerInteractBehaviour>();

        if (player != null)
        {
            if (callback_OnPlayerEnter != null)
            {
                foreach (var item in callback_OnPlayerEnter.GetInvocationList())
                {
                    item.DynamicInvoke(this, player);
                }
            }
        }
    }
 private void onPlayerEnter(PlayerDetectorBehaviour detector, PlayerInteractBehaviour player)
 {
     player.currentReceiver = this;
 }
Esempio n. 11
0
 private void OnPlayerEnter(PlayerDetectorBehaviour det, PlayerInteractBehaviour player)
 {
     endScreen.SetActive(true);
     player.CanMove = false;
 }