FlashPoint.cs 374 B

123456789101112131415161718192021222324
  1. using System;
  2. using UnityEngine;
  3. public class FlashPoint : MonoBehaviour
  4. {
  5. private Transform player
  6. {
  7. get
  8. {
  9. return R.Player.Transform;
  10. }
  11. }
  12. private void OnTriggerEnter2D(Collider2D other)
  13. {
  14. if (other.transform == this.player)
  15. {
  16. this.player.position = this.target.position;
  17. }
  18. }
  19. [SerializeField]
  20. private Transform target;
  21. }