Unity C# Cheat Sheet and Quick Reference
[Pages:1]Unity C# Cheat Sheet and Quick Reference
Create Objects
Instantiate(prefab, position, Quaternion.identity) as Ga meObject;
Destroy Objects
Destroy(myObject);
Accessing Components
gameObj.GetComponent();
GameObject Events
Awake()
Called
before
Start(),
after
prefab
instance.
OnEnable()
Called
just
after
the
object
is
enabled.
Start()
Called
once
per
script
before
first
frame
update.
OnApplicationPause()
Called
at
the
end
of
a
frame
when
the
pause
is
detected.
Update()
Called
once
per
frame
FixedUpdate()
Called
multiple
times
per
frame
as
a
fixed
rate.
Time.deltaTime
not
needed.
LateUpdate()
Called
once
per
frame
after
Update()
has
finished.
Good
for
camera
movement.
OnGUI()
Called
multiple
times
per
frame
in
response
to
GUI
events.
OnApplicationQuit()
Called
on
all
GameObjects
before
game
is
quit.
OnDisable()
Called
when
object
is
disable
or
inactive.
OnDestroy()
Called
after
all
the
updates
in
response
to
Object.Destroy
or
closure
of
a
scene.
Vector Variables
Vector3.up,
Vector3.down,
Vector3.forward,
Vector3.back,
Vector3.left,
Vector3.right,
Vector3.one,
Vector3.zero
myVector.x,
myVector.y,
myVector.z,
myVector.magnitude,
myVector.normalized
Timing Variables
Time.deltaTime
Time
it
took
to
complete
last
frame
Time.fixedTime
Time
since
the
latest
fixedUpdate.
Time.time
The
time
in
seconds
since
the
start
of
the
game.
Time.timeScale
The
scale
at
what
time
is
passing
Physics Events
OnCollisionEnter
OnCollisionStay
OnCollisionExit
OnTriggerEnter
OnTriggerStay
OnTriggerExit
Coroutine Example
private IEnumerator myCoroutine() { for (int i = 0; i < 10; i++) { Debug.Log(i); yield return } StopCoroutine("myCoroutine");
} StartCoroutine("myCoroutine");
Coroutine Return Types
yield
yield
WaitForSeconds
yield
WWW
yield
WaitForFixedUpdate
yield
StartCoroutine
Source: . Visit for more iOS resources and tutorials!
Version 0.1. Copyright 2014 Ray Wenderlich. All rights reserved.
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- unity pacman weebly
- unity and augmented reality scottylabs
- learning 2d game development with unity
- the car tutorial part 3 creating a racing game for unity
- so now we ve got a visual representation of the track and
- chapter 1 movement
- unity c cheat sheet and quick reference
- scripting in unity3d vers 3 4
- unity scripting beginner
- learn unity by creating a 3d multi level platformer game
Related searches
- free excel quick reference sheet
- hospice eligibility quick reference guide
- sba loan quick reference guide
- excel vba quick reference pdf
- excel 2010 quick reference card
- sba quick reference guide 2019
- mla quick reference sheet
- excel 2016 quick reference pdf
- excel quick reference cards 2019
- apa quick reference sheet
- icd 10 quick reference sheets
- icd 10 quick reference list