Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
string colour = "red";string color = "red";class MyClass {
void DoSomething() {
if (someTest) {
// ...
} else {
// ...
}
}
}class MyClass
{
void DoSomething()
{
if (someTest)
{
// ...
}
else
{
// ...
}
}
}if (someTest)
doSomething();
if (someTest) doSomethingElse();if (someTest)
{
DoSomething();
}
if (someTest)
{
DoSomethingElse();
}string username, twitterHandle;string username;
string twitterHandle; public sealed class Container : NetworkActor
{
public event ContainerContentsHandler OnContentsChanged;
public Vector2Int Size;
public AttachedContainer AttachedTo { get; set; }
[SyncObject]
private readonly SyncList<StoredItem> _storedItems = new();
private readonly object _modificationLock = new();
public float LastModification { get; private set; }
public delegate void ContainerContentsHandler(Container container, IEnumerable<Item> oldItems,IEnumerable<Item> newItems, ContainerChangeType type);
... public sealed class Container : NetworkActor
{
public event ContainerContentsHandler OnContentsChanged;
public delegate void ContainerContentsHandler(Container container, IEnumerable<Item> oldItems,IEnumerable<Item> newItems, ContainerChangeType type);
public Vector2Int Size;
private readonly object _modificationLock = new();
[SyncObject]
private readonly SyncList<StoredItem> _storedItems = new();
public AttachedContainer AttachedTo { get; set; }
public float LastModification { get; private set; }
...for (int i = 0; i < 10; i++)
{
Debug.Log("index=" + i);
}for (int i = 0; i < 10; i++)
{
Debug.Log("index=" + i);
}CoolUiWidget widget =
someIncrediblyLongExpression(that, reallyWouldNotFit, on, aSingle, line);CoolUiWidget widget =
someIncrediblyLongExpression(that, reallyWouldNotFit, on, aSingle, line);switch (variable)
{
case 1:
break;
case 2:
break;
default:
break;
}switch (variable)
{
case 1:
break;
case 2:
break;
}switch (variable)
{
case 1:
break;
case 2:
break;
default:
Debug.LogError("Unexpected value when...");
return;
}public List<Transform> FindAThing(int arg){
...
if (notFound) {
throw new NotFoundException();
}
}public List<Transform> FindAThing(int arg){
...
if (notFound) {
Debug.LogError("Thing not found");
return null;
}
}private GameObject _someMember;
private void Start() {
_someMember = GameObject.Find("ObjectName");
}public class : MonoBehaviour
{
private AudioSource _audioSource;
private void Start() {
_audioSource = gameObject.AddCompenent<AudioSource>();
}
}[RequireComponent(typeof(AudioSource))]
public class : MonoBehaviour
{
private AudioSource _audioSource;
private void Start() {
_audioSource = GetCompenent<AudioSource>();
}
}public GameObject SomeMember;[SerializeField] private GameObject _someMember;
public GameObject SomeMember => _someMember;