/// <summary> /// Creates a new preset and adds it to a new state in the list. /// </summary> private void CreateAnimatorAudioStateSetStatePreset() { var animatorAudioState = m_ShootableWeapon.ReloadAnimatorAudioStateSet.States[EditorPrefs.GetInt(SelectedReloadAnimatorAudioStateSetIndexKey)]; var states = StateInspector.CreatePreset(animatorAudioState, animatorAudioState.States, m_ReorderableReloadAnimatorAudioStateSetStateList, GetSelectedAnimatorAudioStateSetStateIndexKey(EditorPrefs.GetInt(SelectedReloadAnimatorAudioStateSetIndexKey))); if (animatorAudioState.States.Length != states.Length) { InspectorUtility.SynchronizePropertyCount(states, m_ReorderableReloadAnimatorAudioStateSetStateList.serializedProperty); Shared.Editor.Utility.EditorUtility.RecordUndoDirtyObject(target, "Change Value"); animatorAudioState.States = states; } }
/// <summary> /// Creates a new preset and adds it to a new state in the list. /// </summary> private void CreateViewTypePreset() { var attribute = m_AttributeManager.Attributes[EditorPrefs.GetInt(SelectedAttributeIndexKey)]; var states = StateInspector.CreatePreset(attribute, attribute.States, m_ReorderableAttributeStateList, GetSelectedAttributeStateIndexKey(attribute)); if (attribute.States.Length != states.Length) { InspectorUtility.SynchronizePropertyCount(states, m_ReorderableAttributeStateList.serializedProperty); InspectorUtility.RecordUndoDirtyObject(target, "Change Value"); attribute.States = states; } }
/// <summary> /// Creates a new preset and adds it to a new state in the list. /// </summary> private void CreateViewTypePreset() { var viewType = m_CameraController.ViewTypes[EditorPrefs.GetInt(SelectedViewTypeIndexKey)]; var states = StateInspector.CreatePreset(viewType, viewType.States, m_ReorderableViewTypeStateList, GetSelectedViewTypeStateIndexKey(viewType)); if (viewType.States.Length != states.Length) { InspectorUtility.SynchronizePropertyCount(states, m_ReorderableViewTypeStateList.serializedProperty); Shared.Editor.Utility.EditorUtility.RecordUndoDirtyObject(target, "Change Value"); viewType.States = states; SerializeViewTypes(); } }
/// <summary> /// Creates a new preset and adds it to a new state in the list. /// </summary> private void CreatePickupSetPreset() { var pickupSet = m_ItemPickup.ItemPickupSet[EditorPrefs.GetInt(SelectedPickupSetIndexKey, -1)]; var states = StateInspector.CreatePreset(pickupSet.ItemSet, pickupSet.ItemSet.States, m_ReorderablePickupSetStateList, GetSelectedPickupSetStateIndexKey(EditorPrefs.GetInt(SelectedPickupSetIndexKey, -1))); if (pickupSet.ItemSet.States.Length != states.Length) { InspectorUtility.SynchronizePropertyCount(states, m_ReorderablePickupSetStateList.serializedProperty); InspectorUtility.RecordUndoDirtyObject(target, "Change Value"); pickupSet.ItemSet.States = states; } }
/// <summary> /// Creates a new preset and adds it to a new state in the list. /// </summary> private void CreateItemSetPreset() { m_ItemSetListIndex = m_ItemSetListIndexAdd; var itemSet = m_ItemSetManager.CategoryItemSets[m_ItemSetListIndex].ItemSetList[EditorPrefs.GetInt(SelectedItemSetIndexKey, -1)]; var states = StateInspector.CreatePreset(itemSet, itemSet.States, m_ReorderableItemSetStateList[m_ItemSetListIndex], GetSelectedItemSetStateIndexKey(EditorPrefs.GetInt(SelectedItemSetIndexKey, -1))); if (itemSet.States.Length != states.Length) { InspectorUtility.SynchronizePropertyCount(states, m_ReorderableItemSetStateList[m_ItemSetListIndex].serializedProperty); Shared.Editor.Utility.EditorUtility.RecordUndoDirtyObject(target, "Change Value"); itemSet.States = states; } }