public void Action() { if (friend != null) { Friend f = friend.GetComponent <Friend>(); if (f != null) { f.Action(); } } }