Koha9
a80f3d6560
Initial commit. Complete project for 'I Wanna Be A Fox' - a 2D scrolling game inspired by 'I Wanna Be The Guy'.
20 lines
402 B
C#
20 lines
402 B
C#
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);
|
|
}
|
|
} |