internal StudioSequence(byte *buffer, Native *nativeMemory) { Data = nativeMemory; Label = Marshal.PtrToStringUTF8(new IntPtr(Data->label)); Events = APIUtils.AllocateListWrapper(buffer, Data->numevents, Data->eventindex, n => new StudioEvent((StudioEvent.Native *)n.ToPointer())); }
public StudioHeader(Native *nativeMemory) { Data = nativeMemory; Name = Marshal.PtrToStringUTF8(new IntPtr(Data->name)); var buffer = (byte *)Data; Bones = APIUtils.AllocateListWrapper(buffer, Data->numbones, Data->boneindex, n => new StudioBone((StudioBone.Native *)n.ToPointer())); BoneControllers = APIUtils.AllocateListWrapper(buffer, Data->numbones, Data->boneindex, n => new StudioBoneController((StudioBoneController.Native *)n.ToPointer())); Sequences = APIUtils.AllocateListWrapper(buffer, Data->numseq, Data->seqindex, n => new StudioSequence(buffer, (StudioSequence.Native *)n.ToPointer())); BodyParts = APIUtils.AllocateListWrapper(buffer, Data->numbodyparts, Data->bodypartindex, n => new StudioBodyPart((StudioBodyPart.Native *)n.ToPointer())); var transitions = new byte[Data->numtransitions]; Marshal.Copy(new IntPtr(buffer + Data->transitionindex), transitions, 0, Data->numtransitions); Transitions = transitions.ToList(); }