Assets/Deps/emotitron/NST Example/Scripts/Weapon.cs
/// <summary>
/// Player with local authority fires by calling this. This tells the NST to create a custom message and attach your data to it.
/// </summary>
/// <param name="wid"></param>
Player with local authority fires by calling this. This tells the NST to create a custom message and attach your data to it.
Player with local authority fires by calling this . This tells the NST to create a custom message and attach your data to it .
public void PlayerFire(WeaponType w)
	{
		int hitId = 0;
		uint hitmask = 0;
		if (w == WeaponType.Hitscan)
		{
			hitmask = CastRay(transform.position, transform.rotation, out hitId);
		}
		PlayerFireCustomMsg customMsg = new PlayerFireCustomMsg
		{
			weaponId = (byte)w,
			color = new Color(Random.value, 
			Random.value, Random.value), hitmask = hitmask
		};
		NetworkSyncTransform.SendCustomEventSimple(customMsg);
	}
public void PlayerFire ( WeaponType w ) { int hitId = 0 ; uint hitmask = 0 ; if ( w == WeaponType . Hitscan ) { hitmask = CastRay ( transform . position , transform . rotation , out hitId ) ; } PlayerFireCustomMsg customMsg = new PlayerFireCustomMsg { weaponId = ( byte ) w , color = new Color ( Random . value , Random . value , Random . value ) , hitmask = hitmask } ; NetworkSyncTransform . SendCustomEventSimple ( customMsg ) ; }
Player with local authority fires by calling this.
Player with local authority fires by calling this .
w
WeaponType
wid
None