// Start is called before the first frame update
    void Start()
    {
        Helico    = GetComponent <Rigidbody>();
        sonHelico = GetComponent <AudioSource>();

        sonExplosion = objetExplosion.GetComponent <AudioSource>();

        //scripts des helices
        heliceScript  = refHelice.GetComponent <TourneObjet>();
        heliceScript2 = refHelice2.GetComponent <TourneObjet>();

        //vitesseMax d'une helice
        vitesseHeliceMax = heliceScript.vitRotMax;

        eauRender = Eau.GetComponent <Renderer>();
    }
Exemple #2
0
    void Start()
    {
        txtCompteur = GetComponent <Text>();

        //à chaque seconde appelle Compteur
        InvokeRepeating("Compteur", 1, 1);

        //va chercher l'helice
        GameObject helice = GameObject.FindGameObjectWithTag("helice");

        scriptHelice = helice.GetComponent <TourneObjet>();

        //va chercher le vehicule
        GameObject vehicule = GameObject.FindGameObjectWithTag("Vehicule");

        scriptVehicule = vehicule.GetComponent <DeplaceVehicule>();
    }