//call the Lit function of the current target object void LightUpObject(GameObject obj) { if (obj == null) { return; } ObjectSelectable select = obj.GetComponent <ObjectSelectable>(); ObjectMultiSelectable multi = obj.GetComponent <ObjectMultiSelectable>(); if (multi != null && !multi.IsLit) { selectedObject = obj; multi.Lit(); isLit = true; return; } if (select != null && !select.IsLit) { selectedObject = obj; select.Lit(); isLit = true; return; } }