void Start(){ input = InputController.main; if (visibility == null){ visibility = GetComponent<ObjectVisibility>(); } GetComponent<Button>().onClick.AddListener(()=>{ if (visibility.visible){ input.invoke_dir(direction); } }); }