using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class WymienKoszulke : MonoBehaviour
{
    private void OnCollisionEnter(Collision o)
    {
        if (o.gameObject.name == "Sphere")
        {
            Material materialNowy = o.gameObject.GetComponent<MeshRenderer>().material;
            Material materialStary = gameObject.GetComponent<MeshRenderer>().material;
            gameObject.GetComponent<Renderer>().material = materialNowy;
            o.gameObject.GetComponent<Renderer>().material = materialStary;
        }
    }
}
