Show Menu
Cheatography

Unity3D - C# Cheat Sheet (DRAFT) by

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Global C# tips

Expression ? doIfTrue : doIfFalse;
FloatC­omp­are­r.A­reEqual ((float)A, (float)B, (float­)Fl­oat­Com­par­er.k­Ep­silon)
using UnityE­ngi­ne.A­ss­ert­ion­s.C­omp­arers;

Debug

Debug.Log
Debug.L­og­Warning
Debug.L­og­Error

GameObject

public GameObject();
public GameOb­jec­t(s­tring name);
T instan­ce.A­dd­Com­pon­ent­<T>();
T instan­ce.G­et­Com­pon­ent­<T>();
Transform x = instan­ce.t­ra­nsform;