コード例 #1
0
        /// <summary>
        /// Adds a new element to the state list which uses an existing preset.
        /// </summary>
        private void AddExistingAnimatorAudioStateSetStatePreset()
        {
            var animatorAudioState = m_ShootableWeapon.ReloadAnimatorAudioStateSet.States[EditorPrefs.GetInt(SelectedReloadAnimatorAudioStateSetIndexKey)];
            var states             = StateInspector.AddExistingPreset(animatorAudioState.GetType(), 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;
            }
        }
コード例 #2
0
        /// <summary>
        /// Adds a new element to the state list which uses an existing preset.
        /// </summary>
        private void AddExistingViewTypePreset()
        {
            var attribute = m_AttributeManager.Attributes[EditorPrefs.GetInt(SelectedAttributeIndexKey)];
            var states    = StateInspector.AddExistingPreset(attribute.GetType(), 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;
            }
        }
コード例 #3
0
        /// <summary>
        /// Adds a new element to the state list which uses an existing preset.
        /// </summary>
        private void AddExistingViewTypePreset()
        {
            var viewType = m_CameraController.ViewTypes[EditorPrefs.GetInt(SelectedViewTypeIndexKey)];
            var states   = StateInspector.AddExistingPreset(viewType.GetType(), 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();
            }
        }
コード例 #4
0
        /// <summary>
        /// Adds a new element to the state list which uses an existing preset.
        /// </summary>
        private void AddExistingPickupSetPreset()
        {
            var pickupSet = m_ItemPickup.ItemPickupSet[EditorPrefs.GetInt(SelectedPickupSetIndexKey, -1)];
            var states    = StateInspector.AddExistingPreset(pickupSet.ItemSet.GetType(), 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;
            }
        }
コード例 #5
0
        /// <summary>
        /// Adds a new element to the state list which uses an existing preset.
        /// </summary>
        private void AddExistingItemSetPreset()
        {
            m_ItemSetListIndex = m_ItemSetListIndexAdd;
            var itemSet = m_ItemSetManager.CategoryItemSets[m_ItemSetListIndex].ItemSetList[EditorPrefs.GetInt(SelectedItemSetIndexKey, -1)];
            var states  = StateInspector.AddExistingPreset(itemSet.GetType(), 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;
            }
        }