override protected void RenameEnded() { string name = string.IsNullOrEmpty(GetRenameOverlay().name) ? GetRenameOverlay().originalName : GetRenameOverlay().name; int instanceID = GetRenameOverlay().userData; bool isCreating = GetCreateAssetUtility().IsCreatingNewAsset(); bool userAccepted = GetRenameOverlay().userAcceptedRename; if (userAccepted) { if (isCreating) { // Create a new asset GetCreateAssetUtility().EndNewAssetCreation(name); } else { // Rename an existing asset ObjectNames.SetNameSmartWithInstanceID(instanceID, name); } } else if (isCreating) { GetCreateAssetUtility().EndNewAssetCreationCanceled(name); } }
protected override void RenameEnded() { bool userAcceptedRename = base.GetRenameOverlay().userAcceptedRename; if (userAcceptedRename) { string name = (!string.IsNullOrEmpty(base.GetRenameOverlay().name)) ? base.GetRenameOverlay().name : base.GetRenameOverlay().originalName; int userData = base.GetRenameOverlay().userData; AudioMixerTreeViewNode audioMixerTreeViewNode = this.m_TreeView.FindNode(userData) as AudioMixerTreeViewNode; if (audioMixerTreeViewNode != null) { ObjectNames.SetNameSmartWithInstanceID(userData, name); AudioMixerEffectController[] effects = audioMixerTreeViewNode.group.effects; for (int i = 0; i < effects.Length; i++) { AudioMixerEffectController audioMixerEffectController = effects[i]; audioMixerEffectController.ClearCachedDisplayName(); } this.m_TreeView.ReloadData(); if (this.m_Controller != null) { this.m_Controller.OnSubAssetChanged(); } } } }
protected override void RenameEnded() { if (!this.GetRenameOverlay().userAcceptedRename) { return; } string name = !string.IsNullOrEmpty(this.GetRenameOverlay().name) ? this.GetRenameOverlay().name : this.GetRenameOverlay().originalName; int userData = this.GetRenameOverlay().userData; AudioMixerTreeViewNode node = this.m_TreeView.FindNode(userData) as AudioMixerTreeViewNode; if (node == null) { return; } ObjectNames.SetNameSmartWithInstanceID(userData, name); foreach (AudioMixerEffectController effect in node.group.effects) { effect.ClearCachedDisplayName(); } this.m_TreeView.ReloadData(); if (!((UnityEngine.Object) this.m_Controller != (UnityEngine.Object)null)) { return; } this.m_Controller.OnSubAssetChanged(); }
protected override void RenameEnded() { string name = !string.IsNullOrEmpty(base.GetRenameOverlay().name) ? base.GetRenameOverlay().name : base.GetRenameOverlay().originalName; int userData = base.GetRenameOverlay().userData; if (base.GetRenameOverlay().userAcceptedRename) { ObjectNames.SetNameSmartWithInstanceID(userData, name); TreeViewItem item = base.m_TreeView.data.FindItem(userData); if (item != null) { item.displayName = name; } EditorApplication.RepaintAnimationWindow(); } }
protected override void RenameEnded() { string name = !string.IsNullOrEmpty(base.GetRenameOverlay().name) ? base.GetRenameOverlay().name : base.GetRenameOverlay().originalName; int userData = base.GetRenameOverlay().userData; bool flag = this.GetCreateAssetUtility().IsCreatingNewAsset(); if (base.GetRenameOverlay().userAcceptedRename) { if (flag) { this.GetCreateAssetUtility().EndNewAssetCreation(name); } else { ObjectNames.SetNameSmartWithInstanceID(userData, name); } } }
protected override void RenameEnded() { string name = !string.IsNullOrEmpty(this.GetRenameOverlay().name) ? this.GetRenameOverlay().name : this.GetRenameOverlay().originalName; int userData = this.GetRenameOverlay().userData; bool flag = this.GetCreateAssetUtility().IsCreatingNewAsset(); if (!this.GetRenameOverlay().userAcceptedRename) { return; } if (flag) { this.GetCreateAssetUtility().EndNewAssetCreation(name); this.m_TreeView.ReloadData(); } else { ObjectNames.SetNameSmartWithInstanceID(userData, name); } }
override protected void RenameEnded() { string name = string.IsNullOrEmpty(GetRenameOverlay().name) ? GetRenameOverlay().originalName : GetRenameOverlay().name; int instanceID = GetRenameOverlay().userData; bool userAccepted = GetRenameOverlay().userAcceptedRename; if (userAccepted) { ObjectNames.SetNameSmartWithInstanceID(instanceID, name); // Manually set the name so no visual pop happens TreeViewItem item = m_TreeView.data.FindItem(instanceID); if (item != null) { item.displayName = name; } EditorApplication.RepaintAnimationWindow(); } }
protected override void RenameEnded() { bool userAccepted = GetRenameOverlay().userAcceptedRename; if (userAccepted) { string name = string.IsNullOrEmpty(GetRenameOverlay().name) ? GetRenameOverlay().originalName : GetRenameOverlay().name; int instanceID = GetRenameOverlay().userData; var audioNode = m_TreeView.FindItem(instanceID) as AudioMixerTreeViewNode; if (audioNode != null) { ObjectNames.SetNameSmartWithInstanceID(instanceID, name); foreach (var effect in audioNode.group.effects) { effect.ClearCachedDisplayName(); } m_TreeView.ReloadData(); if (m_Controller != null) { m_Controller.OnSubAssetChanged(); } } } }