| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 | using HQFPSWeapons;using System.Collections;using System.Collections.Generic;using UnityEngine;public class tpsGunData : MonoBehaviour{    public string weaponName;    public Transform holding_rightHandPosition;    public Transform aiming_rightHandPosition;    public Transform leftHandPosition;    public Transform headTarget;    [Header("Shooting Properties")]    public GameObject tracerPref;    public GameObject muzzleFlashPref;    public Transform weaponTip;    public Light muzzleLight;    public float muzzleLightIntensity = 0;    public float muzzleLightMaxIntensity = 2;    private void Update()    {        muzzleLight.intensity = muzzleLightIntensity;        if(muzzleLightIntensity > 0)        {            muzzleLightIntensity -= 0.1f;        }    }    public void triggerMuzzleFlash()    {        muzzleLightIntensity = muzzleLightMaxIntensity;        if (tracerPref != null)        {            PoolableObject tracer = PoolingManager.Instance.GetObject(                    tracerPref,                    weaponTip.position,                    weaponTip.rotation                );         }        if (muzzleFlashPref != null)        {            Quaternion muzzleFlashRot = Quaternion.Euler(new Vector3(                    Random.Range(0, 180),                    Random.Range(0, 180),                    Random.Range(0, 180)));            PoolableObject muzzleFlash = PoolingManager.Instance.GetObject(                    muzzleFlashPref,                    weaponTip.position,                    muzzleFlashRot                );        }       // foreach (GameObject go in muzzleFlash)       // {      //      go.SetActive(true);      //  }     //   StartCoroutine(disableMuzzleFlashAfterTime(2));    }    IEnumerator disableMuzzleFlashAfterTime(float timeInSeconds)    {        yield return new WaitForSeconds(timeInSeconds);      //  foreach (GameObject go in muzzleFlash)      //  {      //      go.SetActive(false);      //  }    }}
 |