scripts
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Timeline
|
||||
{
|
||||
// Token: 0x0200003E RID: 62
|
||||
internal static class TimelineCreateUtilities
|
||||
{
|
||||
// Token: 0x060001FD RID: 509 RVA: 0x0000A180 File Offset: 0x00008380
|
||||
public static string GenerateUniqueActorName(TimelineAsset timeline, string prefix)
|
||||
{
|
||||
string text;
|
||||
if (!timeline.tracks.Exists((TrackAsset x) => x.name == prefix))
|
||||
{
|
||||
text = prefix;
|
||||
}
|
||||
else
|
||||
{
|
||||
int num = 1;
|
||||
string newName = prefix + num;
|
||||
while (timeline.tracks.Exists((TrackAsset x) => x.name == newName))
|
||||
{
|
||||
num++;
|
||||
newName = prefix + num;
|
||||
}
|
||||
text = newName;
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
// Token: 0x060001FE RID: 510 RVA: 0x0000A227 File Offset: 0x00008427
|
||||
public static void SaveAssetIntoObject(Object childAsset, Object masterAsset)
|
||||
{
|
||||
if ((masterAsset.hideFlags & HideFlags.DontSave) != HideFlags.None)
|
||||
{
|
||||
childAsset.hideFlags |= HideFlags.DontSave;
|
||||
}
|
||||
else
|
||||
{
|
||||
childAsset.hideFlags |= HideFlags.HideInHierarchy;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060001FF RID: 511 RVA: 0x0000A260 File Offset: 0x00008460
|
||||
internal static bool ValidateParentTrack(TrackAsset parent, Type childType)
|
||||
{
|
||||
bool flag;
|
||||
if (childType == null || !typeof(TrackAsset).IsAssignableFrom(childType))
|
||||
{
|
||||
flag = false;
|
||||
}
|
||||
else if (parent == null)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
SupportsChildTracksAttribute supportsChildTracksAttribute = Attribute.GetCustomAttribute(parent.GetType(), typeof(SupportsChildTracksAttribute)) as SupportsChildTracksAttribute;
|
||||
if (supportsChildTracksAttribute == null)
|
||||
{
|
||||
flag = false;
|
||||
}
|
||||
else if (supportsChildTracksAttribute.childType == null)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
else if (childType == supportsChildTracksAttribute.childType)
|
||||
{
|
||||
int num = 0;
|
||||
TrackAsset trackAsset = parent;
|
||||
while (trackAsset != null && trackAsset.isSubTrack)
|
||||
{
|
||||
num++;
|
||||
trackAsset = trackAsset.parent as TrackAsset;
|
||||
}
|
||||
flag = num < supportsChildTracksAttribute.levels;
|
||||
}
|
||||
else
|
||||
{
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user