public override void OnInspectorGUI() { // Update serializedObject.Update(); DrawDefaultInspector(); if (GUILayout.Button("Apply Person Type")) { setupMobilePerson.ApplyPersonSettingsViaInspector(); } if (GUILayout.Button("Align To Ground")) { MobilePersonBillboard mobilePerson = setupMobilePerson.GetComponentInChildren <MobilePersonBillboard>(); if (mobilePerson) { Vector3 billboardSize = mobilePerson.GetBillboardSize(); GameObjectHelper.AlignBillboardToGround(setupMobilePerson.gameObject, billboardSize); } } // Save modified properties serializedObject.ApplyModifiedProperties(); if (GUI.changed) { EditorUtility.SetDirty(target); } }
public void ApplyPersonSettings() { MobilePersonBillboard mobilePerson = GetMobilePersonChildScript(); if (mobilePerson) { mobilePerson.SetPerson((Races)race, gender); } }