void sendShip()
    {
        if (actual_ship_index >= all__ships.Count)
        {
            actual_ship_index = 0;
        }

        GameObject ship = all__ships[actual_ship_index];

        ship.SetActive(true);



        float radius = Random.Range(min_radius, max_radius);

        float angle = Random.Range(0, 360) * Mathf.PI / 180;

//		float coordX = Random.Range (min_radius, max_radius);
//		float coordZ = Random.Range (min_radius, max_radius);
//		if (Random.Range(0,2) ==0) {
//			coordX = -coordX;
//		}
//
//		if (Random.Range(0,2) ==0) {
//			coordZ = -coordZ;
//		}
        Vector3 new_position = new Vector3(radius * Mathf.Cos(angle), 0, radius * Mathf.Sin(angle));

        ship.transform.position = transform.position + new_position;

        CatchAnimalAndRun catchScript = ship.AddComponent <CatchAnimalAndRun>();

        catchScript.index_ship      = actual_ship_index;
        catchScript.light_abduction = ship.transform.Find("LightShip").gameObject;
        catchScript.light_abduction.SetActive(false);

        actual_ship_index++;



        //sending a space ship random color

        EnemyData data = ship.GetComponent <EnemyData> ();

        int index        = data.ship_random_index;
        int randomFinger = 0;

        Finger.FingerType fingerUse = Finger.FingerType.TYPE_THUMB;

        if (HoldParametersVecinosInvasores.mode_game == HoldParametersVecinosInvasores.COLORS)
        {
            randomFinger = Random.Range(0, HoldParametersVecinosInvasores.fingerTypes.Count);
            fingerUse    = HoldParametersVecinosInvasores.fingerTypes [randomFinger];
        }
        data.setMaterialFinger(materials_by_ships[index][fingerUse], fingerUse);
    }
예제 #2
0
 public void disableShip(GameObject enemie)
 {
     if (enemie.gameObject.activeSelf == true)
     {
         CatchAnimalAndRun cacthScript = enemie.transform.GetComponent <CatchAnimalAndRun> ();
         if (cacthScript != null)
         {
             cacthScript.releaseAnimal();
             score_handler.sum_score(5);
         }
         //sounds.sound_explotion.Play ();
         effectFireworks.simulateFireworkIn(enemie.transform.position);
         enemie.SetActive(false);
     }
 }