示例#1
0
    void Start()
    {
        GameObject gameControllerObject = GameObject.FindWithTag("GameController");
        GameObject ammoTextObj          = GameObject.FindWithTag("ScoreText");

        ammoText = ammoTextObj.GetComponent <GUIText> ();
        GameObject shotSpawn1Obj = GameObject.FindWithTag("ShotSpawn1");

        shotSpawn1 = shotSpawn1Obj.GetComponent <ShotSpawn1> ();

        motherShipOrig = motherShipHp;                                                                                  // setting the hit points and fuel original vaules..
        fuelOrig       = fuel;


        if (gameControllerObject != null)
        {
            gameController = gameControllerObject.GetComponent <GameController> ();
        }
        if (gameController == null)
        {
            Debug.Log("Cannot find 'GameController' script");
        }
    }
    void Start()
    {
        GameObject gameControllerObject = GameObject.FindWithTag ("GameController");
        GameObject ammoTextObj = GameObject.FindWithTag( "ScoreText");
        ammoText = ammoTextObj.GetComponent<GUIText> ();
        GameObject shotSpawn1Obj = GameObject.FindWithTag( "ShotSpawn1");
        shotSpawn1 = shotSpawn1Obj.GetComponent<ShotSpawn1> ();

        motherShipOrig = motherShipHp;										// setting the hit points and fuel original vaules..
        fuelOrig = fuel;

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