unity [SerializeField] code example

Example 1: unity serializefield

//Shows the private variable in the Unity Inspector
[SerializeField]
private string name;

Example 2: unity no serializefield

[System.NonSerialized]
public int Num = 5;

Example 3: unity addforceatposition

rigidbody.AddForceAtPosition(force, worldPosition);

Example 4: unity matchinfo

MatchInfo.matchInfo = networkManager.matchInfo;
networkManager.matchMaker.DropConnection(matchInfo.networkId, matchInfo.nodeId, 0, networkManager.OnDropConnection);
networkManager.StopHost();