Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // IF STATEMENT
- if (moveX < 0)
- { transform.localEulerAngles = new Vector3(0f, 0f, 15f); }
- else { transform.localEulerAngles = new Vector3(0f, 0f, -15f); }
- // CONDITIONAL EXPRESSION:
- // Target Variable Condition / if Consequent / true Alternative / false
- transform.localEulerAngles = moveX < 0 ? new Vector3(0f, 0f, 15f) : new Vector3(0f, 0f, -15f);
- // If Condition is true, transform.localEulerangles is set to 0,0,15
- // If the condition the "target variable" is set to be 0,0-15
- // IF STATEMENT
- if (Input.GetKey(KeyCode.LeftShift))
- { _acceleration = _boost; }
- else { _acceleration = _base; }
- // CONDITIONAL EXPRESSION
- // Target variable - _acceleration
- // Condition - Input.GetKey(KeyCode.LeftShift)
- // True - Boost
- // False - Base
- _acceleration = Input.GetKey(KeyCode.LeftShift) ? _boost : _base;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement