comparison Assets/Application/Scripts/DeathZone.cs @ 12:b55d586dd4eb

change bind from fmap.
author Kazuma Takeda
date Tue, 07 Feb 2017 20:48:57 +0900
parents 3fefb9f9025d
children
comparison
equal deleted inserted replaced
11:cf20add31466 12:b55d586dd4eb
3 using UnityEngine; 3 using UnityEngine;
4 4
5 public class DeathZone : MonoBehaviour { 5 public class DeathZone : MonoBehaviour {
6 6
7 private GameObject target; 7 private GameObject target;
8 private Vector3 firstPoint = new Vector3(0.5f, 2f, 0.5f); 8 private Vector3 firstPoint;
9 9
10 public delegate void HitCallback (int n); 10 public delegate void HitCallback (int n);
11 public HitCallback hitcallback; 11 public HitCallback hitcallback;
12 12
13 public void SetHitCallback (HitCallback hc) { 13 public void SetHitCallback (HitCallback hc) {
14 this.hitcallback = hc; 14 this.hitcallback = hc;
15 } 15 }
16 16
17 private void Start () { 17 private void Start () {
18 target = GameObject.FindGameObjectWithTag ("Player"); 18 target = GameObject.FindGameObjectWithTag ("Player");
19 firstPoint = target.transform.position;
19 } 20 }
20 21
21 private void Update () { 22 private void Update () {
22 Vector3 pos = target.transform.position; 23 Vector3 pos = target.transform.position;
23 this.transform.position = new Vector3 (pos.x, this.transform.position.y, pos.z); 24 this.transform.position = new Vector3 (pos.x, this.transform.position.y, pos.z);