I_wanna_be_a_Fox/Assets/Its_a_trap.cs

20 lines
402 B
C#
Raw Permalink Normal View History

using UnityEngine;
using System.Collections;
public class Its_a_trap : MonoBehaviour
{
Player kitsune;
void Start()
{
kitsune = GetComponent<Player>();
}
// ぶつかった瞬間に呼び出される
void OnTriggerEnter2D(Collider2D c)
{
Debug.Log("AHHHHHH!");
GameObject.Find("Player").transform.position = new Vector3(2.0f, 5.0f, 0);
}
}