public virtual void LoadLayer(BinaryReader BR, Microsoft.Xna.Framework.Content.ContentManager Content, Dictionary <string, Timeline> DicTimeline) { Name = BR.ReadString(); LayerBlendState = (LayerBlendStates)BR.ReadByte(); _LayerSamplerStates = (LayerSamplerStates)BR.ReadByte(); UpdateSamplerState(); int DicGroupEventCount = BR.ReadInt32(); DicGroupEvent = new Dictionary <uint, GroupTimeline>(DicGroupEventCount); for (int T = 0; T < DicGroupEventCount; T++) { uint Key = BR.ReadUInt32(); GroupTimeline NewGroup = new GroupTimeline(BR.ReadString()); int GroupIndex = BR.ReadInt32(); NewGroup.GroupIndex = GroupIndex; NewGroup.KeyValue = Key; DicGroupEvent.Add(Key, NewGroup); } int DicTimelineEventCount = BR.ReadInt32(); DicTimelineEvent = new Dictionary <int, List <Timeline> >(DicTimelineEventCount); for (int T = 0; T < DicTimelineEventCount; T++) { int ListEventCount = BR.ReadInt32(); for (int E = 0; E < ListEventCount; E++) { Timeline ActiveEvent = Timeline.Load(BR, Content, this, DicTimeline); if (!DicTimelineEvent.ContainsKey(ActiveEvent.SpawnFrame)) { DicTimelineEvent.Add(ActiveEvent.SpawnFrame, new List <Timeline>()); } DicTimelineEvent[ActiveEvent.SpawnFrame].Add(ActiveEvent); } } int ChildrenCount = BR.ReadInt32(); for (int L = 0; L < ChildrenCount; L++) { AnimationLayer NewChildrenLayer = new AnimationLayer(Owner, ""); NewChildrenLayer.LoadLayer(BR, Content, DicTimeline); ListChildren.Add(NewChildrenLayer); } }
public AnimationLayer(AnimationClass Owner, string Name) { this.Name = Name; this.Owner = Owner; ListChildren = new List <AnimationLayer>(); DicTimelineEvent = new Dictionary <int, List <Timeline> >(); ListVisibleObject = new List <VisibleTimeline>(); ListActiveMarker = new List <MarkerTimeline>(); ListPolygonCutter = new List <PolygonCutterTimeline>(); DicGroupEvent = new Dictionary <uint, GroupTimeline>(); _LayerBlendState = LayerBlendStates.Add; _LayerSamplerStates = LayerSamplerStates.LinearClamp; SamplerState = SamplerState.LinearClamp; ShowChildren = true; IsVisible = true; IsLocked = false; IsSelected = false; }