Inheritance: GearSocket
Exemplo n.º 1
0
        /// <summary>
        /// Using Base Init for default Setup.
        /// Creating needed Setup for Laser.
        /// </summary>
        /// <param name="weaponSocket">Place for Weapon to create</param>
        /// <param name="weapon">What Weapon</param>
        /// <param name="hud">Weapon View for Visuals</param>
        /// <param name="aimOrigin"></param>
        /// <param name="hitEvent"></param>
        public override void Initialize(WeaponSocket weaponSocket, Weapon weapon, WeaponHud hud, AimOrigin aimOrigin,
                                        HitEvent hitEvent)
        {
            base.Initialize(weaponSocket, weapon, hud, aimOrigin, hitEvent);

            PhotonView.ObservedComponents.Add(this);

            // 1 default + reflect count
            m_rayNums = 1 + Weapon.ReflectCount;

            m_rays = new Ray[m_rayNums + 1];

            //max x reflections = x hits + 1 end point
            m_hitEffects = new ParticleSystem[Weapon.ReflectCount + 1];

            //each reflection is a hit + 1 end point
            for (var i = 0; i < Weapon.ReflectCount + 1; i++)
            {
                m_hitEffects[i] = Instantiate(weapon.HitEffect);
            }

            m_trailEffect = Instantiate(Weapon.TrailEffect, MuzzleFlash.transform, false).GetComponent <LineRenderer>();
            m_trailEffect.transform.localPosition = new Vector3(0, 0, 0);

            m_currentLength = Weapon.MaxLength;
        }
Exemplo n.º 2
0
        public override void Initialize(WeaponSocket weaponSocket, Weapon weapon, WeaponHud hud, AimOrigin aimOrigin,
                                        HitEvent hitEvent)
        {
            base.Initialize(weaponSocket, weapon, hud, aimOrigin, hitEvent);
            m_hitEffect = Instantiate(weapon.HitEffect);
            PhotonView.ObservedComponents.Add(this);

            m_trailEffect = Instantiate(Weapon.TrailEffect, MuzzleFlash.transform, false).GetComponent <TrailRenderer>();
            m_trailEffect.transform.localPosition = new Vector3(0, 0, 0);
        }
Exemplo n.º 3
0
        public override void Initialize(WeaponSocket weaponSocket, Weapon weapon, WeaponHud hud, AimOrigin aimOrigin,
                                        HitEvent hitEvent)
        {
            base.Initialize(weaponSocket, weapon, hud, aimOrigin, hitEvent);
            m_hitEffect = Instantiate(weapon.HitEffect);

            m_chargeEffect = Instantiate(weapon.ChargeEffect, WeaponObject.transform, false);
            m_chargeEffect.transform.localPosition = Weapon.MuzzleFlashOffset;

            //Get Components to Handle Effects
            var lineEffects = Instantiate(Weapon.TrailEffect, MuzzleFlash.transform, false);

            m_lineRender = lineEffects.GetComponent <LineRenderer>();
            m_lineRender.transform.localPosition = new Vector3(0, 0, 0);
            m_lineRender.positionCount           = 2;
            m_lineRender.widthMultiplier         = Weapon.RayThickness * 10;
            m_lineRender.enabled = false;

            m_lineAnimation = lineEffects.GetComponent <LineAnimation>();
        }
Exemplo n.º 4
0
		public virtual void Initialize(WeaponSocket weaponSocket, Weapon weapon, WeaponHud hud, AimOrigin aimOrigin,
			HitEvent hitEvent)
		{
			PhotonView = GetComponent<PhotonView>();
			m_rigidbody = GetComponent<Rigidbody>();
			WeaponAudio = GetComponent<AudioSource>();
			m_shield = GetComponent<Shield>();
			m_playerMovementModel = GetComponent<PlayerMovementModel>();
			HitEvent = hitEvent;
			m_weaponHud = hud;
			WeaponSocket = weaponSocket;
			Weapon = weapon;
			AimOrigin = aimOrigin;
			CameraShake = CameraShake.Instance;

			CreateWeapon();
			CreateMuzzleFlash();

			WeaponCollision = WeaponObject.GetComponent<WeaponCollision>();

			m_currentAmmo = Weapon.AmmoClip;

			m_weaponHud.SetAmmoAmount(m_currentAmmo, Weapon.AmmoClip);
		}
Exemplo n.º 5
0
 public void Initialize(WeaponSocket _sock, ReticleScript _ret)
 {
     sock = _sock;
     ret  = _ret;
 }