This code uses the C# ternary operator.
This construct consists of three parts. A condition and two values.
<condition> ? <value_true> : <value_false>
When the condition is true, this construct returns the first value. When the condition is false, it returns the second value.
So what happens here is that the condition Application.platform == RuntimePlatform.IPhonePlayer is being evaluated. When it is true, then _gameId gets set to _iOSGameId. When it is false, then _gameId gets set to _androidGameId.
If you feel uncomfortable with ternary expression, then you could also write the whole method as this:
public void InitializeAds()
{
if(Application.platform == RuntimePlatform.IPhonePlayer)
{
_gameId = _iOSGameId;
}
else
{
_gameId = _androidGameId;
}
Advertisement.Initialize(_gameId, _testMode, this);
}
What's immediately visible here is that any platform except iPhone is assumed to be Android. I am not familiar with the Unity ingame advertisement API, but this has some obvious code smell to me.