playMaker
Home
Store
Showcase
Tutorials
Forums
Manual
Wiki
About Us
Playmaker Forum
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Join our
Discord Channel
Home
Help
Search
Login
Register
Playmaker Forum
»
PlayMaker Help & Tips
»
PlayMaker Help
»
What does this line of code mean exactly?
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: What does this line of code mean exactly? (Read 2341 times)
Disastercake
Full Member
Posts: 101
www.disastercake.com
What does this line of code mean exactly?
«
on:
May 25, 2012, 07:45:24 PM »
I found this line of code in the Set Position event.
positionChange = space == Space.World ? go.transform.position : go.transform.localPosition;
I'm unfamiliar with this "==" and ":" and "?" syntax. Would someone mind explaining this to me?
Logged
Soul Saga - Anime themed adventure RPG by Disastercake
http://www.disastercake.com
Alex Chouls
Administrator
Hero Member
Posts: 4000
Official Playmaker Support
Re: What does this line of code mean exactly?
«
Reply #1 on:
May 26, 2012, 01:47:42 AM »
It's a more compact way of saying:
if (space == Space.world)
{
positionChange = go.transform.position;
}
else
{
positionChange = go.transform.localPosition;
}
Logged
Print
Pages: [
1
]
Go Up
« previous
next »
Playmaker Forum
»
PlayMaker Help & Tips
»
PlayMaker Help
»
What does this line of code mean exactly?