public override void OnInspectorGUI() { ApplyForces applyForces = (ApplyForces)this.target; GameObject addTo = applyForces.gameObject; var isGoBack = false; var proxy = addTo.GetComponentInParent <Proxy>(); if (proxy) { addTo = proxy.gameObject; } if ((addTo != applyForces.gameObject) && GUILayout.Button("Back to Content", MarsEditorGUI.Styles.MiniFontButton)) { isGoBack = true; } if (ForcesMenuItemsRegions.DrawForcesInInspectorForMainProxy(addTo, true)) { isGoBack = true; } if (isGoBack) { Selection.activeObject = addTo; } }
static void EditorCreateAlignmentTo_OtherProxy(MenuCommand command) { var selection = CurrentEditorSelection(command); var proxy = ForcesMenuItemsRegions.EnsureProxyForcesOnGameobject(ref selection); var aligner = Undo.AddComponent <ProxyAlignmentForce>(proxy.gameObject); aligner.targetRelation = ProxyAlignmentForceType.SceneInitialRelativePose; AfterConfiguredComponent(aligner); }