Ejemplo n.º 1
0
    void Start()
    {
        GameObject gameControllerObject = GameObject.FindWithTag("GameController");                     // making the declarations..

        fighterShooter1 = GameObject.FindWithTag("FShooter1");
        hpText          = GameObject.FindWithTag("HP");
        GameObject ammoTextObj = GameObject.FindWithTag("ScoreText");

        ammoText       = ammoTextObj.GetComponent <GUIText> ();
        hP             = hpText.GetComponent <GUIText> ();
        fighterShooter = fighterShooter1.GetComponent <FighterShooter> ();

        fighter1Orig = fighter1Hp;                                                                                                                              // setting the hit points and fuel original vaules..
        fuelOrig     = fuel;

        fuelText.text = "Fuel: ";                                                                                                                               // updating the guitext.
        hP.text       = "Hull Integrity: ";


        if (gameControllerObject != null)
        {
            gameController = gameControllerObject.GetComponent <GameController> ();
        }
        if (gameController == null)
        {
            Debug.Log("Cannot find 'GameController' script");
        }
    }
    void Start()
    {
        GameObject gameControllerObject = GameObject.FindWithTag ("GameController");		// making the declarations..
        fighterShooter1 = GameObject.FindWithTag ("FShooter1");
        hpText = GameObject.FindWithTag ("HP");
        GameObject ammoTextObj = GameObject.FindWithTag( "ScoreText");
        ammoText = ammoTextObj.GetComponent<GUIText> ();
        hP = hpText.GetComponent<GUIText> ();
        fighterShooter = fighterShooter1.GetComponent<FighterShooter> ();

        fighter1Orig = fighter1Hp;															// setting the hit points and fuel original vaules..
        fuelOrig = fuel;

        fuelText.text = "Fuel: ";															// updating the guitext.
        hP.text = "Hull Integrity: ";

        if (gameControllerObject != null)
        {
            gameController = gameControllerObject.GetComponent <GameController> ();
        }
        if (gameController == null)
        {
            Debug.Log ("Cannot find 'GameController' script");
        }
    }