Assets/Deps/emotitron/NST Example/Scripts/Weapon.cs
/// <summary>
/// When a custom message is taken from the buffer and applied for interpolation, the OnCustomMsgRcvEvent is fired. Note that the rotations 
/// will only be correct if you have the NST set to update rotations on events. If it is set to 'changes only' these rotations values will be zero.
/// </summary>
When a custom message is taken from the buffer and applied for interpolation, the OnCustomMsgRcvEvent is fired. Note that the rotations
will only be correct if you have the NST set to update rotations on events. If it is set to 'changes only' these rotations values will be zero.
When a custom message is taken from the buffer and applied for interpolation the OnCustomMsgRcvEvent is fired . Note that the rotations will only be correct if you have the NST set to update rotations on events . If it is set to ' changes only ' these rotations values will be zero .
private static void OnCustomMsgApply(NetworkConnection ownerConn, byte[] bytearray, NetworkSyncTransform nst, Vector3 pos, List<GenericX> positions, List<GenericX> rotations)
	{
		Weapon wpn = nst.GetComponent<Weapon>();
		PlayerFireCustomMsg weaponFireMsg = bytearray.DeserializeToStruct<PlayerFireCustomMsg>();
		if (nst == NetworkSyncTransform.lclNST)
			return;
		if (weaponFireMsg.weaponId == (byte)WeaponType.Mine)
			wpn.FireMine(wpn.turret.transform.position, rotations[1], weaponFireMsg);
	}
private static void OnCustomMsgApply ( NetworkConnection ownerConn , byte [ ] bytearray , NetworkSyncTransform nst , Vector3 pos , List < GenericX > positions , List < GenericX > rotations ) { Weapon wpn = nst . GetComponent < Weapon > ( ) ; PlayerFireCustomMsg weaponFireMsg = bytearray . DeserializeToStruct < PlayerFireCustomMsg > ( ) ; if ( nst == NetworkSyncTransform . lclNST ) return ; if ( weaponFireMsg . weaponId == ( byte ) WeaponType . Mine ) wpn . FireMine ( wpn . turret . transform . position , rotations [ 1 ] , weaponFireMsg ) ; }
When a custom message is taken from the buffer and applied for interpolation, the OnCustomMsgRcvEvent is fired.
When a custom message is taken from the buffer and applied for interpolation the OnCustomMsgRcvEvent is fired .
ownerConn
NetworkConnection
bytearray
byte[]
nst
NetworkSyncTransform
pos
Vector3
positions
List<GenericX>
rotations
List<GenericX>