Exemplo n.º 1
0
    void Start()
    {
        /*
         * GameObject player = Instantiate(playerPrefab, spawnLocations[0].position, Quaternion.identity);
         * GameObject camera = Instantiate(playerCamera, spawnLocations[0].position, Quaternion.identity);
         */

        // find it and assign it automatically
        testManager = FindObjectOfType <Test_manager>();
        // spawn player with all of the settings sent over by testManager
        SpawnPlayer(testManager.bodyValue, testManager.turretValue, testManager.engineValue, testManager.trackValue);
        // spawn a camera targeted at objects with tag Player
        GameObject camera = Instantiate(playerCamera, spawnLocations[0].position, Quaternion.identity);
    }
Exemplo n.º 2
0
    /*
     *  - Make all of this information sendable through non destructable game object to another scene
     *  - Spawn player in another scene with customizations set up + with functional code added to each part
     *  - See how different functionality on different parts will work. If thats trash, just manage it all in one place
     */

    private void Start()
    {
        // spawn the first default tank , with default part prefabs
        tankBody       = Instantiate(tankBodies[bodySelection], transform.position, Quaternion.identity);
        tankTurret     = Instantiate(tankTurrets[turretSelection], tankBody.transform.GetChild(0).position, Quaternion.identity);
        tankEngine     = Instantiate(tankEngines[engineSelection], tankBody.transform.GetChild(1).position, Quaternion.identity);
        tankTrackLeft  = Instantiate(tankTracks[trackSelection], tankBody.transform.GetChild(2).position, Quaternion.identity);
        tankTrackRight = Instantiate(tankTracks[trackSelection], tankBody.transform.GetChild(3).position, Quaternion.identity);

        // set all parts as child of Body
        ParentOptions(tankTurret, tankBody);
        ParentOptions(tankEngine, tankBody);
        ParentOptions(tankTrackLeft, tankBody);
        ParentOptions(tankTrackRight, tankBody);

        // get the test manager component for later use
        testManager = GameObject.Find("Manager_TEST").GetComponent <Test_manager>();
    }