Assets/Deps/emotitron/NST Example/Scripts/Weapon.cs
/// <summary>
/// This is the secondary weapon fire code created for this example. It just creates a basic non-synced projectile.
/// </summary>
This is the secondary weapon fire code created for this example. It just creates a basic non-synced projectile.
This is the secondary weapon fire code created for this example . It just creates a basic non - synced projectile .
private void FireMine(Vector3 pos, Quaternion rot, PlayerFireCustomMsg msg)
	{
		Debug.DrawRay(pos, rot * Vector3.forward * 10, Color.red, .5f, true);
		GameObject bullet = Instantiate(minePrefab);
		Rigidbody rb = bullet.GetComponent<Rigidbody>();
		bullet.transform.position = pos;
		bullet.transform.rotation = turret.transform.parent.rotation * rot;
		bullet.GetComponentInChildren<MeshRenderer>().material.color = msg.color;
		Destroy(bullet, 2f);
		rb.velocity = bullet.transform.forward * 5;
	}
private void FireMine ( Vector3 pos , Quaternion rot , PlayerFireCustomMsg msg ) { Debug . DrawRay ( pos , rot * Vector3 . forward * 10 , Color . red , .5f , true ) ; GameObject bullet = Instantiate ( minePrefab ) ; Rigidbody rb = bullet . GetComponent < Rigidbody > ( ) ; bullet . transform . position = pos ; bullet . transform . rotation = turret . transform . parent . rotation * rot ; bullet . GetComponentInChildren < MeshRenderer > ( ) . material . color = msg . color ; Destroy ( bullet , 2f ) ; rb . velocity = bullet . transform . forward * 5 ; }
This is the secondary weapon fire code created for this example.
This is the secondary weapon fire code created for this example .
pos
Vector3
rot
Quaternion
msg
PlayerFireCustomMsg