Il me sert, pour choisir ou respawn :
Code : Tout sélectionner
using UnityEngine;
using System.Collections;
public class debugstatetmort : MonoBehaviour
{
Vector2 position;
void OnTriggerEnter2D(Collider2D other)
{
if (other.tag == "Player")
{
other.transform.position = position;
}
}
}
ce script est fait pour passer d'un niveau à un autre :
Code : Tout sélectionner
using UnityEngine;
using System.Collections;
public class finetpasse : MonoBehaviour
{
string levelname = "Enter Level Name here";
void OnTriggerEnter2D(Collider2D other)
{
if (other.tag == "Player")
{
Application.LoadLevel(levelname);
}
}
}