Show Menu

Unity 3D (C#) - Common Functions Cheat Sheet (DRAFT) by

Common Unity 3D functions/snippets

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

Common Code Snippets

Parent­Gam­eOb­jec­t.t­ran­sfo­rm.G­et­Child (0)
Get child component of GameObject
Rigidb­ody.Ad­dTo­rqu­e((­Vector3 torque, ForceMode mode = ForceM­ode.Force)
Continuous force along the direction of the force vector

C# Principles

(condi­tion1 && condit­ion2) ? true : false
A single line condit­ional statement
public <ty­pe> <na­me> {get; set;}
Single­-line property creation (prop in VS)
public Apple(­string newColor) : base(n­ewC­olor)
This specifies the parent constr­uctor if a constr­uctor is not already present

Free Assets


Useful Links