Ejemplo n.º 1
0
        void ISignalAssetProvider.CreateNewSignalAsset(string path)
        {
            var newSignalAsset = SignalManager.CreateSignalAssetInstance(path);

            m_CurrentReceiver.ChangeSignalAtIndex(m_CurrentRowIdx, newSignalAsset);
            AssetDatabase.CreateAsset(newSignalAsset, path);
        }
Ejemplo n.º 2
0
        void ISignalAssetProvider.CreateNewSignalAsset(string path)
        {
            var newSignalAsset = SignalManager.CreateSignalAssetInstance(path);

            Undo.RecordObject(m_CurrentReceiver, Styles.UndoCreateSignalAsset);
            m_CurrentReceiver.ChangeSignalAtIndex(m_CurrentRowIdx, newSignalAsset);
            PrefabUtility.RecordPrefabInstancePropertyModifications(m_CurrentReceiver);
        }
Ejemplo n.º 3
0
        void ISignalAssetProvider.CreateNewSignalAsset(string path)
        {
            var newSignalAsset = SignalManager.CreateSignalAssetInstance(path);

            AssignSignalAsset(newSignalAsset);
            var receivers = m_Receivers.OfType <SignalReceiver>().ToList();

            if (signalAsset != null && receivers.Count == 1 && !receivers.Any(r => r.IsSignalAssetHandled(newSignalAsset))) // Only when one receiver is present
            {
                receivers[0].AddNewReaction(newSignalAsset);                                                                // Add reaction on the first receiver from the list
                ApplyChangesAndRefreshReceivers();
            }
        }
Ejemplo n.º 4
0
        void ISignalAssetProvider.CreateNewSignalAsset(string path)
        {
            var newSignalAsset = SignalManager.CreateSignalAssetInstance(path);

            AssignSignalAsset(newSignalAsset);
            var receivers = m_Receivers.OfType <SignalReceiver>().ToList();

            if (signalAsset != null && receivers.Count == 1 && !receivers.Any(r => r.IsSignalAssetHandled(newSignalAsset))) // Only when one receiver is present
            {
                receivers[0].AddNewReaction(newSignalAsset);                                                                // Add reaction on the first receiver from the list
                ApplyChangesAndRefreshReceivers();
            }

            //this call can trigger a GC pass, which can invalid the current inspector
            AssetDatabase.CreateAsset(newSignalAsset, path);
        }
Ejemplo n.º 5
0
        void ISignalAssetProvider.CreateNewSignalAsset(string path)
        {
            var newSignalAsset = SignalManager.CreateSignalAssetInstance(path);

            Undo.RecordObject(m_CurrentReceiver, Styles.UndoCreateSignalAsset);

            // case 1241170 - overwriting an existing signal with throw an exception. Instead, clear the old key
            int index = m_CurrentReceiver.GetRegisteredSignals().ToList().IndexOf(newSignalAsset);

            if (index != -1)
            {
                m_CurrentReceiver.ChangeSignalAtIndex(index, null);
            }

            m_CurrentReceiver.ChangeSignalAtIndex(m_CurrentRowIdx, newSignalAsset);
            PrefabUtility.RecordPrefabInstancePropertyModifications(m_CurrentReceiver);
        }