Exemplo n.º 1
0
    // Use this for initialization
    public virtual void Start()
    {
        if (isPickup)
        {
            return;
        }
        Transform tempObject = FindParent.FindParentTransformWithTag("Player", transform);

        while (FindParent.FindParentTransformWithTag("Player", tempObject) != null)
        {
            tempObject = FindParent.FindParentTransformWithTag("Player", tempObject);
        }
        Debug.Log(FindParent.callAmount);
        player           = tempObject.gameObject;
        playerProperties = player.GetComponent <PlayerProperties>();
        reticleUIElement = player.transform.Find("SinglePlayer UI/Reticle").gameObject;

        if (anim == null)
        {
            anim = GetComponent <Animator>();
        }
        aud        = GetComponent <AudioSource>();
        updateAmmo = player.transform.Find("SinglePlayer UI/HUD/Ammo Count").GetComponent <UpdateAmmo>();

        if (reticleGameObject && reticleGameObject.GetComponent <SpriteRenderer>())
        {
            Debug.Log("There is a reticle gameObject attached to this weapon");

            reticle = reticleGameObject.GetComponent <SpriteRenderer>().sprite;
        }
    }
Exemplo n.º 2
0
    void Start()
    {
        ammo1 = ammo1Helper;
        ammo2 = ammo2Helper;
        ammo3 = ammo3Helper;

        ammo1.UpdateAmmoUI(Ammo1);
        ammo2.UpdateAmmoUI(Ammo2);
        ammo3.UpdateAmmoUI(Ammo3);
    }
Exemplo n.º 3
0
    // Use this for initialization
    void Start()
    {
        aud          = GetComponent <AudioSource>();
        player       = transform.root.gameObject;
        weaponSwitch = player.GetComponent <WeaponSwitch>();
        gunAnim      = GetComponent <Animator>();
        updateAmmo   = player.transform.Find("SinglePlayer UI/HUD/Ammo Count").GetComponent <UpdateAmmo>();
        if (ammoAmount == null)
        {
            ammoAmount = transform.Find("Ammo").GetComponent <Amount>();
        }

        cam = player.transform.Find("Camera").GetComponent <Camera>();
        playerPropterties = player.GetComponent <PlayerProperties>();
    }