示例#1
0
    void OnCollisionStay2D(Collision2D other)
    {
        CharacterMovement2_5b sonny = other.gameObject.GetComponent <CharacterMovement2_5b>();

        if (sonny != null)
        {
            sonny.ChangeHealth(-1);
        }
    }
示例#2
0
    void OnTriggerEnter2D(Collider2D other)
    {
        CharacterMovement2_5b sonny = other.GetComponent <CharacterMovement2_5b>();

        if (sonny != null)
        {
            sonny.getGun();
            Destroy(this.gameObject);
        }
    }
示例#3
0
    void OnCollisionEnter2D(Collision2D other)
    {
        CharacterMovement2_5b sonny = other.collider.GetComponent <CharacterMovement2_5b>();

        if (sonny != null)
        {
            sonny.ChangeHealth(-1);
        }
        Destroy(gameObject, despawnTime);
    }
示例#4
0
        public void GiveItemToPlayer()
        {
            Debug.Log("Give TIem To PLayer");
            CharacterMovement2_5b inventoryUI = TargetPlayer.GetComponent <CharacterMovement2_5b>();

            if ((inventoryUI != null) && (itemonPedestal))
            {
                //   inventoryUI.inventoryItems.Add(giftItem);
                inventoryUI.hasEgg = true;
                itemonPedestal     = false;
                displayItem.SetActive(false);
            }
            Debug.Log("Giving");
        }