public void OnGUI () { if (onlyOnDoubleClick && cam != null && Event.current.type == EventType.MouseDown && Event.current.clickCount == 2) { UpdateTargetPosition (); } }