Here are the examples of the csharp api System.Collections.Generic.IEnumerable.Contains(TrackAsset) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
2 Examples
19
Source : TimelineDataSource.cs
with MIT License
from chstetco
with MIT License
from chstetco
TimelineTrackBaseGUI CreateItem(ScriptableObject scriptableObject, ref Dictionary<Trackreplacedet, TimelineTrackBaseGUI> tree, IEnumerable<Trackreplacedet> selectedRows, TreeViewItem parentTreeViewItem)
{
// if a script doesn't load correctly, the trackreplacedet will be NULL, but the scriptableObject __should_ be intact (but == null will be true)
var trackreplacedet = scriptableObject as Trackreplacedet;
if (tree == null)
throw new ArgumentNullException("tree");
if (selectedRows == null)
throw new ArgumentNullException("selectedRows");
if (trackreplacedet != null && tree.ContainsKey(trackreplacedet))
return tree[trackreplacedet];
TimelineTrackBaseGUI parenreplacedem = parentTreeViewItem as TimelineTrackBaseGUI;
// should we create the parent?
Trackreplacedet parentTrack = trackreplacedet != null ? (trackreplacedet.parent as Trackreplacedet) : null;
if (trackreplacedet != null && parentTrack != null && selectedRows.Contains(parentTrack))
{
parenreplacedem = CreateItem(parentTrack, ref tree, selectedRows, parentTreeViewItem);
}
int theDepth = -1;
if (parenreplacedem != null)
theDepth = parenreplacedem.depth;
theDepth++;
TimelineTrackBaseGUI newItem;
if (trackreplacedet == null)
{
Playablereplacedet parent = m_TimelineWindow.state.editSequence.replacedet;
if (parenreplacedem != null && parenreplacedem.track != null)
parent = parenreplacedem.track;
newItem = new TimelineTrackErrorGUI(m_TreeView, m_ParentGUI, 0, theDepth, parenreplacedem, "ERROR", scriptableObject, parent);
}
else if (trackreplacedet.GetType() != typeof(GroupTrack))
{
newItem = new TimelineTrackGUI(m_TreeView, m_ParentGUI, trackreplacedet.GetInstanceID(), theDepth, parenreplacedem, trackreplacedet.name, trackreplacedet);
}
else
{
newItem = new TimelineGroupGUI(m_TreeView, m_ParentGUI, trackreplacedet.GetInstanceID(), theDepth, parenreplacedem, trackreplacedet.name, trackreplacedet, false);
}
allTrackGuis.Add(newItem);
if (parenreplacedem != null)
{
if (parenreplacedem.children == null)
parenreplacedem.children = new List<TreeViewItem>();
parenreplacedem.children.Add(newItem);
}
else
{
m_Rooreplacedem = newItem;
SetExpanded(m_Rooreplacedem, true);
}
if (trackreplacedet != null)
tree[trackreplacedet] = newItem;
var actorAsAnimTrack = newItem.track as AnimationTrack;
bool isEditableInfiniteClip = actorAsAnimTrack != null && actorAsAnimTrack.ShouldShowInfiniteClipEditor();
if (isEditableInfiniteClip)
{
if (newItem.children == null)
newItem.children = new List<TreeViewItem>();
}
else if (trackreplacedet != null)
{
// check if clips on this track have animation, if so we inline a animationEditorTrack
bool clipHasAnimatableAnimationCurves = false;
for (var i = 0; i != newItem.track.clips.Length; ++i)
{
var curveClip = newItem.track.clips[i].curves;
var animationClip = newItem.track.clips[i].animationClip;
// prune out clip with zero curves
if (curveClip != null && curveClip.empty)
curveClip = null;
if (animationClip != null && animationClip.empty)
animationClip = null;
// prune out clips coming from FBX
if (animationClip != null && ((animationClip.hideFlags & HideFlags.NotEditable) != 0))
animationClip = null;
if (!newItem.track.clips[i].recordable)
animationClip = null;
clipHasAnimatableAnimationCurves = (curveClip != null) || (animationClip != null);
if (clipHasAnimatableAnimationCurves)
break;
}
if (clipHasAnimatableAnimationCurves)
{
if (newItem.children == null)
newItem.children = new List<TreeViewItem>();
}
}
if (trackreplacedet != null)
{
// Here we are using the internal subTrackObject so we can properly handle tracks whose script
// can't load (via ScriptableObject)
foreach (var subTrack in trackreplacedet.subTracksObjects)
{
CreateItem(subTrack, ref tree, selectedRows, newItem);
}
}
return newItem;
}
19
Source : TimelineDataSource.cs
with MIT License
from gucheng0712
with MIT License
from gucheng0712
TimelineTrackBaseGUI CreateItem(ScriptableObject scriptableObject, ref Dictionary<Trackreplacedet, TimelineTrackBaseGUI> tree, IEnumerable<Trackreplacedet> selectedRows, TreeViewItem parentTreeViewItem)
{
// if a script doesn't load correctly, the trackreplacedet will be NULL, but the scriptableObject __should_ be intact (but == null will be true)
var trackreplacedet = scriptableObject as Trackreplacedet;
if (tree == null)
throw new ArgumentNullException("tree");
if (selectedRows == null)
throw new ArgumentNullException("selectedRows");
if (trackreplacedet != null && tree.ContainsKey(trackreplacedet))
return tree[trackreplacedet];
TimelineTrackBaseGUI parenreplacedem = parentTreeViewItem as TimelineTrackBaseGUI;
// should we create the parent?
Trackreplacedet parentTrack = trackreplacedet != null ? (trackreplacedet.parent as Trackreplacedet) : null;
if (trackreplacedet != null && parentTrack != null && selectedRows.Contains(parentTrack))
{
parenreplacedem = CreateItem(parentTrack, ref tree, selectedRows, parentTreeViewItem);
}
int theDepth = -1;
if (parenreplacedem != null)
theDepth = parenreplacedem.depth;
theDepth++;
TimelineTrackBaseGUI newItem;
if (trackreplacedet == null)
{
Playablereplacedet parent = m_TimelineWindow.state.editSequence.replacedet;
if (parenreplacedem != null && parenreplacedem.track != null)
parent = parenreplacedem.track;
newItem = new TimelineTrackErrorGUI(m_TreeView, m_ParentGUI, 0, theDepth, parenreplacedem, "ERROR", scriptableObject, parent);
}
else if (trackreplacedet.GetType() != typeof(GroupTrack))
{
newItem = new TimelineTrackGUI(m_TreeView, m_ParentGUI, trackreplacedet.GetInstanceID(), theDepth, parenreplacedem, trackreplacedet.name, trackreplacedet);
}
else
{
newItem = new TimelineGroupGUI(m_TreeView, m_ParentGUI, trackreplacedet.GetInstanceID(), theDepth, parenreplacedem, trackreplacedet.name, trackreplacedet, false);
}
allTrackGuis.Add(newItem);
if (parenreplacedem != null)
{
if (parenreplacedem.children == null)
parenreplacedem.children = new List<TreeViewItem>();
parenreplacedem.children.Add(newItem);
SetExpanded(newItem, trackreplacedet.GetCollapsed());
}
else
{
m_Rooreplacedem = newItem;
SetExpanded(m_Rooreplacedem, true);
}
if (trackreplacedet != null)
tree[trackreplacedet] = newItem;
var actorAsAnimTrack = newItem.track as AnimationTrack;
bool isEditableInfiniteClip = actorAsAnimTrack != null && actorAsAnimTrack.ShouldShowInfiniteClipEditor();
if (isEditableInfiniteClip)
{
if (newItem.children == null)
newItem.children = new List<TreeViewItem>();
}
else if (trackreplacedet != null)
{
// check if clips on this track have animation, if so we inline a animationEditorTrack
bool clipHasAnimatableAnimationCurves = false;
for (var i = 0; i != newItem.track.clips.Length; ++i)
{
var curveClip = newItem.track.clips[i].curves;
var animationClip = newItem.track.clips[i].animationClip;
// prune out clip with zero curves
if (curveClip != null && curveClip.empty)
curveClip = null;
if (animationClip != null && animationClip.empty)
animationClip = null;
// prune out clips coming from FBX
if (animationClip != null && ((animationClip.hideFlags & HideFlags.NotEditable) != 0))
animationClip = null;
if (!newItem.track.clips[i].recordable)
animationClip = null;
clipHasAnimatableAnimationCurves = (curveClip != null) || (animationClip != null);
if (clipHasAnimatableAnimationCurves)
break;
}
if (clipHasAnimatableAnimationCurves)
{
if (newItem.children == null)
newItem.children = new List<TreeViewItem>();
}
}
if (trackreplacedet != null)
{
// Here we are using the internal subTrackObject so we can properly handle tracks whose script
// can't load (via ScriptableObject)
foreach (var subTrack in trackreplacedet.subTracksObjects)
{
CreateItem(subTrack, ref tree, selectedRows, newItem);
}
}
return newItem;
}