コード例 #1
0
    // Use this for initialization
    void Start()
    {
        inv             = GameObject.FindWithTag("GameController");
        player          = GameObject.FindWithTag("Player");
        _uiManager      = GameObject.Find("Canvas").GetComponent <UIManager>();
        playerHealthvar = player.GetComponent <PlayerHealth>();

        // I connect this script with the script <BoxWithGold>
        GameObject bxgold = GameObject.FindWithTag("chest");

        bx = bxgold.GetComponent <BoxWithGold>();

        // I connect this script with the PickUp Script
        GameObject pickUpGO = GameObject.FindWithTag("ItemMG");

        _pickUP = pickUpGO.GetComponent <PickUp>();

        // I connect this script with the WeaponSwitching script
        GameObject wSwitchGO = GameObject.FindWithTag("WeaponSW");

        _wswitch = wSwitchGO.GetComponent <WeaponSwitcsing>();

        _currency = GameObject.FindWithTag("GameController").GetComponent <Currency>();

        ////I connect this script with the Currency
        //GameObject curGO = GameObject.FindWithTag("Currency");
        //_currency = curGO.GetComponent<Currency>();
    }
コード例 #2
0
    // Use this for initialization
    void Start()
    {
        // // Connect pickup script with Currency
        //GameObject moneyScriptGO = GameObject.FindWithTag("GoldCoins");
        _currency = GameObject.FindWithTag("GameController").GetComponent <Currency>();

        invScript = GameObject.FindWithTag("GameController").GetComponent <InventoryChris>();

        // I connect this script with the WeaponSwitching script
        GameObject wSwitchGO = GameObject.FindWithTag("WeaponSW");

        _wswitch = wSwitchGO.GetComponent <WeaponSwitcsing>();
    }