MCPcopy Create free account
hub / github.com/esengine/esengine / setup

Method setup

packages/fairygui/src/core/Transition.ts:723–786  ·  view source on GitHub ↗
(buffer: ByteBuffer)

Source from the content-addressed store, hash-verified

721 }
722
723 public setup(buffer: ByteBuffer): void {
724 this.name = buffer.readS();
725 this._options = buffer.getInt32();
726 this._autoPlay = buffer.readBool();
727 this._autoPlayTimes = buffer.getInt32();
728 this._autoPlayDelay = buffer.getFloat32();
729
730 const cnt = buffer.getInt16();
731 for (let i = 0; i < cnt; i++) {
732 const dataLen = buffer.getInt16();
733 const curPos = buffer.position;
734
735 buffer.seek(curPos, 0);
736
737 const item: ITransitionItem = {
738 type: buffer.readByte() as ETransitionActionType,
739 time: buffer.getFloat32(),
740 targetId: '',
741 value: {},
742 displayLockToken: 0
743 };
744
745 const targetId = buffer.getInt16();
746 if (targetId >= 0) {
747 const child = this._owner.getChildAt(targetId);
748 item.targetId = child?.id || '';
749 }
750
751 item.label = buffer.readS();
752
753 if (buffer.readBool()) {
754 buffer.seek(curPos, 1);
755 item.tweenConfig = {
756 duration: buffer.getFloat32(),
757 easeType: buffer.readByte() as EEaseType,
758 repeat: buffer.getInt32(),
759 yoyo: buffer.readBool(),
760 startValue: {},
761 endValue: {},
762 endLabel: buffer.readS()
763 };
764
765 buffer.seek(curPos, 2);
766 this.decodeValue(item.type, buffer, item.tweenConfig.startValue);
767
768 buffer.seek(curPos, 3);
769 this.decodeValue(item.type, buffer, item.tweenConfig.endValue);
770 } else {
771 buffer.seek(curPos, 2);
772 this.decodeValue(item.type, buffer, item.value);
773 }
774
775 this._items.push(item);
776 buffer.position = curPos + dataLen;
777 }
778
779 this._totalDuration = 0;
780 for (const item of this._items) {

Callers 1

Calls 10

decodeValueMethod · 0.95
readSMethod · 0.80
getInt32Method · 0.80
readBoolMethod · 0.80
getFloat32Method · 0.80
getInt16Method · 0.80
readByteMethod · 0.80
getChildAtMethod · 0.80
seekMethod · 0.65
pushMethod · 0.65

Tested by

no test coverage detected