public void OnUnselected(ExposeToEditor obj) { Rigidbody rig = obj.GetComponent <Rigidbody>(); if (rig) { rig.isKinematic = true; } CubemanCharacter cubeman = obj.GetComponent <CubemanCharacter>(); if (cubeman != null) { cubeman.Move(Vector3.zero, false, false); cubeman.Enabled = false; } CubemanUserControl userCtrl = obj.GetComponent <CubemanUserControl>(); if (userCtrl != null) { userCtrl.HandleInput = false; } }