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

public class CollisionManager : MonoBehaviour {

   public GameObject[] Planetas = new GameObject[2];

   void OnCollisionEnter(Collision collision)
    {
        Debug.Log(this.name);
        for (int i = 0; i < Planetas.Length; i++)
        {
            if(collision.gameObject.name == Planetas[i].name)
            {
                Mensajes(Planetas[i].name);
            }
        }
    }

    void Mensajes(string nPlanet) {

        switch (nPlanet)
        {
            case "planeta 1":
             Debug.Log("llegaste al planeta 1");
            break;
            case "planeta 2":
                Debug.Log("llegaste al planeta 2");
                break;
        }
    }
}
