read static method

KeyFrame? read(
  1. StreamReader reader,
  2. ActorComponent? component
)
override

Implementation

static KeyFrame? read(StreamReader reader, ActorComponent? component) {
  KeyFrameDrawOrder frame = KeyFrameDrawOrder();
  if (!KeyFrame.read(reader, frame)) {
    return null;
  }
  reader.openArray('drawOrder');
  int numOrderedNodes = reader.readUint16Length();
  frame._orderedNodes = <DrawOrderIndex>[];
  for (int i = 0; i < numOrderedNodes; i++) {
    reader.openObject('order');
    DrawOrderIndex drawOrder = DrawOrderIndex(
        reader.readId('component'), reader.readUint16('order'));
    reader.closeObject();
    frame._orderedNodes.add(drawOrder);
  }
  reader.closeArray();
  return frame;
}