Exemple #1
0
 // Use this for initialization
 void Start()
 {
     move = GameObject.Find ("Butterfly").GetComponent<ButterflyMove> ();
     try{
         if(NextPath == null)
             NextPath = null;
     }
     catch{
     }
 }
Exemple #2
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (Active) {
         if (other.gameObject.name == "Player") {
             SpawnPoint.transform.position = new Vector3 (gameObject.transform.position.x, gameObject.transform.position.y + 1.5f, gameObject.transform.position.z);
             path = GameObject.Find ("Butterfly").GetComponent<ButterflyMove> ();
             path.FirstPath = ClosestPath;
             Active = false;
         }
     }
 }
Exemple #3
0
 // Update is called once per frame
 void Update()
 {
     if (lives == 0) {
         SpawnPoint.transform.position = InitialSpawn.transform.position;
         gameObject.transform.position = SpawnPoint.transform.position;
         lives = NumberOfLives;
         path = GameObject.Find ("Butterfly").GetComponent<ButterflyMove> ();
         path.FirstPath = ClosestPath;
         path.Reset();
         CheckPointCollision[] c = GameObject.Find("Checkpoints").GetComponentsInChildren<CheckPointCollision>();
         foreach (var item in c) {
             item.Reset();
         }
         PlantCollision[] p = GameObject.Find("Plants").GetComponentsInChildren<PlantCollision>();
         foreach (var item in p) {
             item.Reset();
         }
         reset.Reset();
     }
 }
Exemple #4
0
 void Start()
 {
     m = ButterFly.GetComponent<ButterflyMove> ();
 }