Ejemplo n.º 1
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.CompareTag("Player"))
     {
         other.gameObject.transform.position = destination.transform.position + destination.transform.forward;
         other.gameObject.transform.Rotate(0, 30, 0);
         UnityStandardAssets.Characters.FirstPerson.FirstPersonController fpc = other.gameObject.GetComponent <UnityStandardAssets.Characters.FirstPerson.FirstPersonController>();
         var type = fpc.GetType();
         if (type.GetMethod("SetRotation") != null)
         {
             fpc.SetRotation(destination.transform);
         }
     }
 }