Esempio n. 1
0
    public void OnCollisionEnter2D(Collision2D collision)
    {
        GameObject gameObj = collision.gameObject;
        Player     player  = gameObj.GetComponent <Player>();

        if (player != null)
        {
            if (gameState.playerWeaponUpgrades == null || gameState.playerWeaponUpgrades.Count == 0)
            {
                GameObject  textPopup    = Instantiate(textPopupComponent, transform.position + new Vector3(0.5f, 0.5f, 0), Quaternion.identity);
                DamagePopup textPopupObj = textPopup.GetComponent <DamagePopup>();
                textPopupObj.SetupVendingMachine();
                Destroy(textPopup, 6f);
            }
        }
    }