码迷,mamicode.com
首页 > 其他好文 > 详细

fly bird 案例代码_MoveTrigger

时间:2015-11-08 19:25:54      阅读:178      评论:0      收藏:0      [点我收藏+]

标签:

 1 using UnityEngine;
 2 using System.Collections;
 3 
 4 public class MoveTrigger : MonoBehaviour {
 5     
 6     public Transform currentBg;
 7     public pipe pipe01;
 8     public pipe pipe02;
 9 
10     void OnTriggerEnter(Collider other) {
11         if (other.tag == "Player") {
12             Transform firstBg = GameMangger._intance.firstBg;
13             currentBg.position = new Vector3(firstBg.position.x + 10, 
14                 currentBg.position.y, currentBg.position.z);
15 
16             GameMangger._intance.firstBg = currentBg;
17             pipe01.RandomGeneratePosition();
18             pipe02.RandomGeneratePosition();
19         }
20     }
21 }

 

fly bird 案例代码_MoveTrigger

标签:

原文地址:http://www.cnblogs.com/wry524/p/4947821.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!