2025.03.09 unity  
 2025.03.09 unity  
 2025.03.09 unity  
 2025.03.09 unity  
 2025.03.08 unity  
 2024.11.30 unity  
 2024.11.30 unity  
 2024.11.30 未分類  

WarpDoor


using UnityEngine;
public class WarpDoor : MonoBehaviour
{
public Vector2 warpPoint;
private Vector3 target;	
void Start()
 {
 }
void Update()
    {
    } 
void OnTriggerEnter2D (Collider2D other) {
  target = other.gameObject.transform.position;
  target.x = warpPoint.x;
  target.y = warpPoint.y;
  other.gameObject.transform.position = target;
   }
}