Could someone translate this into c# for me please as I am trying to follow a tutorial on how to create a trigger for my enemies if at all possible finding it quite difficult to understand, if I can see this in javascript it will make me understand a bit better I hope someone can help me out here: 
the link
using UnityEngine;
using System.Collections;
public class PlayerTriggers : MonoBehaviour
{
public GameObject Enemy;
void OnTriggerEnter(Collider col)
{
switch(col.gameObject.name)
{
case "enemy1trigger":
Debug.Log("Collided with enemy1 spawntrigger");
Destroy (col.gameObject);
Transform enemy;
GameObject enemyspawn = GameObject.Find("enemy1spawn");
Enemy = Instantiate(enemy, enemyspawn.transform.position,enemyspawn.transform.rotation)as Transform;
break;
}
}
}
Translate it yourself, its a really simple script. In the Unity script reference you can find examples of each class in both languages, there you check the differences between them, This way you will learn a lot more than just doing the tutorial. Unity Script Reference <— put whatever you dont understand in the search bar here.
thanks for the response ray I will try and desect it and check the reference that you have provided
kind regards
heh ray would it be something like this and I take it would be attached to my player. this is what I have in my scene
enemy1spawn - where enemy is spawned from
enemytrigger - when the player hit this trigger(its ticked in the inspector) it spawns the enemy
enemy - is a gameobject that will be tagged in the inspector
the only thing I cant work out is do I have to declare any sort of variables like the enemy variable out of interest:
var enemy : transform;
function OnTriggerEnter (hit : Collider)
{
switch(hit.gameObject.name)
{
case "enemy1trigger"; // which would be a wall or something to set the trigger
Debug.Log("Collided with enemy1 spawntrigger");
gameObject enemyspawn = gameObject.tag("enemy1spawn");
enemy = Instantiate(enemy, enemyspawn.transform.position,enemyspawn.transform.rotation)
break;
}
}
}
can anyone help me or direct me on how to make a respawn for multiple enemies I need some sort of direction as I still cannot seem to get there either via videos or links
cheers