ワープ装置の作成
ワープドア
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class WarpDoor : MonoBehaviour
{
public Vector2 pos;
public AudioClip sound;
private void OnTriggerEnter2D(Collider2D collision)
{
collision.gameObject.transform.position = pos;
AudioSource.PlayClipAtPoint(sound, transform.position);
}
}
【2022版】ActionGame2D(全33回)
他のコースを見るワープドア
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class WarpDoor : MonoBehaviour
{
public Vector2 pos;
public AudioClip sound;
private void OnTriggerEnter2D(Collider2D collision)
{
collision.gameObject.transform.position = pos;
AudioSource.PlayClipAtPoint(sound, transform.position);
}
}
ワープ装置の作成