Exemplo n.º 1
0
    void Start()
    {
        Transform inGameUITransform = GameObject.Find("/Canvas/InGame").transform;

        shopText = inGameUITransform.Find("ShopText").GetComponent <Text>();

        audioSource   = GetComponent <AudioSource>();
        weaponManager = GetComponentInChildren <WeaponManager>();
        cashSystem    = GetComponent <CashSystem>();
    }
Exemplo n.º 2
0
    void Start()
    {
        Transform inGameUITransform = GameObject.Find("/Canvas/InGame").transform;

        weaponNameText = inGameUITransform.Find("WeaponNameText").GetComponent <Text>();
        ammoText       = inGameUITransform.Find("AmmoText").GetComponent <Text>();

        GameObject player = GameObject.FindGameObjectWithTag("Player");

        controller  = player.GetComponent <FirstPersonController>();
        animator    = GetComponent <Animator>();
        audioSource = GetComponent <AudioSource>();
        cashSystem  = player.GetComponent <CashSystem>();

        bulletsInClip = clipSize;
        bulletsLeft   = maxAmmo;

        // Wait until weapon can fire
        Invoke("EnableWeapon", 1f);
    }