Пример #1
0
    protected override void Awake()
    {
        base.Awake();

        rateOfFireTimer = 0f;

        recoiler = GetComponentInChildren <Recoiler> ();
    }
Пример #2
0
    private void Start()
    {
        gunRecoiler = GetComponentInParent <Recoiler>();
        camRecoiler = FPSCamera.GetComponentInParent <Recoiler>();

        gunData.currentAmmo = gunData.magazineCapacity;

        if (audioSource == null)
        {
            audioSource = gameObject.AddComponent <AudioSource>();
        }

        bulletHitController = GetComponent <BulletHitController>();
    }
Пример #3
0
    private void Start()
    {
        // Recolier components references from gun and camera

        GUNRecoiler = GetComponentInParent <Recoiler>();
        CAMRecoiler = FPSCAMERA.GetComponentInParent <Recoiler>();



        gunData.currentAmmo = gunData.magazineCapacity;

        if (audioSource == null)
        {
            audioSource = gameObject.AddComponent <AudioSource>();
        }
    }
Пример #4
0
    private void Start()
    {
        //Recoiler components references from gun and camera
        gunRecoiler = GetComponentInParent <Recoiler>();
        camRecoiler = fpsCamera.GetComponentInParent <Recoiler>();

        //Start with full clip
        gunData.currentAmmo = gunData.magazineCapacity;
        GameObject.Find("AmmoText").GetComponent <UnityEngine.UI.Text>().text = gunData.currentAmmo + "/" + gunData.magazineCapacity;

        audioSource = GetComponent <AudioSource>();

        //If there is no audioSource component in the gameObject, add one.
        if (audioSource == null)
        {
            audioSource = gameObject.AddComponent <AudioSource>();
        }
    }