fly bird 案例代码_MoveTrigger

 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)