示例#1
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        Mechanics player = collision.GetComponent <Mechanics>();

        if (player != null)
        {
            if (!Inventary.inventary.weapons.Contains(weapon))
            {
                informationManager.TakeInformation(weapon.messageOn);
                Inventary.inventary.AddWeapon(weapon);
                player.AddWeapon(weapon);
            }
            else
            {
                informationManager.TakeInformation(weapon.messageOFF);
            }
            Destroy(gameObject);
        }
    }