Version: 2018.2
public bool isConnected ;

Description

Returns true when Editor is connected to the player.