void SpawnNucleon()
    {
        Nucleon prefab = nucleonPrefabs[Random.Range(0, nucleonPrefabs.Length)];
        Nucleon spawn  = Instantiate <Nucleon>(prefab);

        spawn.transform.localPosition = Random.onUnitSphere * spawnDistance;
    }
Пример #2
0
    private void SpawnNucleon()
    {
        Nucleon prefab = prefabs[Random.Range(0, prefabs.Length)];
        Nucleon spawn  = Instantiate <Nucleon>(prefab);

        spawn.transform.localScale    = Vector3.one;
        spawn.transform.localPosition = Random.onUnitSphere * distanceSpawns;
    }
    void SpawnNucleon()
    {
        nucleonsAndProteonsCounter++;
        objectsCount.text = nucleonsAndProteonsCounter.ToString();
        Nucleon prefab = nucleonPrefabs[Random.Range(0, nucleonPrefabs.Length)];
        Nucleon spawn  = Instantiate(prefab);

        spawn.transform.localPosition = Random.onUnitSphere * spawnDistance;
    }
Пример #4
0
    void SpawnNucleon()
    {
        Nucleon prefab = nucleonPrefabs[Random.Range(0, nucleonPrefabs.Length)];
        Nucleon spawn  = Instantiate <Nucleon>(prefab);

        spawn.transform.localPosition = spawning() * spawnDistance;
        spawn.transform.SetParent(transform);
        ++nb_spawn;
    }
    void SpawnNucleon()
    {
        Nucleon prephap = nucleonPrephaps[Random.Range(0, nucleonPrephaps.Length)];
        Nucleon spawn   = Instantiate <Nucleon>(prephap);

        spawn.transform.parent = this.transform;
        //spawn.GetComponent<MeshRenderer>().material.color = Random.ColorHSV();
        spawn.transform.localPosition = Random.onUnitSphere * spawnDistance;
    }
    //spawns the nucleon
    void SpawnNucleon()
    {
        //randomly picks an assigned prefab
        Nucleon prefab = nucleonPrefabs[Random.Range(0, nucleonPrefabs.Length)];
        Nucleon spawn  = Instantiate <Nucleon>(prefab);

        spawn.transform.parent = this.transform;
        //randomly places the nucleon along a sphere
        spawn.transform.localPosition = Random.onUnitSphere * spawnDistance;
    }
    void SpawnNucleon()
    {
        //Getting a random nucleon from our prefab array
        Nucleon prefab = nucleonPrefabs[Random.Range(0, nucleonPrefabs.Length)];
        //Instantiting a Nucleon with the selected prefab
        Nucleon instance = Instantiate <Nucleon>(prefab);

        //and setting the local position of the nucleon to a random spherepoint times spawndistance
        instance.transform.localPosition = Random.onUnitSphere * spawnDistance;
    }
Пример #8
0
    void SpawnNucleon()
    {
        // Randomly select a prefab
        Nucleon prefab = nucleonPrefabs[Random.Range(0, nucleonPrefabs.Length)];

        // Instantitate it
        Nucleon spawn = Instantiate <Nucleon>(prefab);

        // Giving it a random position to start
        spawn.transform.localPosition = Random.onUnitSphere * spawnDistance;
    }
Пример #9
0
    void SpawnNucleon()
    {
        // pick a random prefab
        Nucleon prefab = nucleonPrefabs[Random.Range(0, nucleonPrefabs.Length)];

        // instantiate it
        Nucleon spawn = Instantiate <Nucleon> (prefab);

        objectCount++;

        // position it
        spawn.transform.localPosition = Random.onUnitSphere * spawnDistance;
    }
Пример #10
0
    //========================================================

    private void SpawnNucleon()
    {
        Nucleon obj = Instantiate <Nucleon>(nucleonPrefabs[Random.Range(0, nucleonPrefabs.Length)], transform);

        obj.transform.localPosition = Random.onUnitSphere * spawnDistance;
    }
    void SpawnNucleon(int index)
    {
        Nucleon spawn = Instantiate(nucleonPrefabs[index]);

        spawn.transform.localPosition = Random.onUnitSphere * spawnDistance;
    }