Function addAccessor

  • [en] Add accessor via extending Object prototypes

    Example

    addAccessor(Object3D.prototype, "x", {
    get() {
    return this.position.x;
    },
    set(v) {
    this.position.x = v;
    },
    });

    Type Parameters

    • T

    Parameters

    • obj: T
    • prop: string
    • accessor: {
          get: ((this: T) => any);
          set: ((this: T, v: any) => any);
      }
      • get: ((this: T) => any)
          • (this: T): any
          • Parameters

            • this: T

            Returns any

      • set: ((this: T, v: any) => any)
          • (this: T, v: any): any
          • Parameters

            • this: T
            • v: any

            Returns any

    Returns void

Generated using TypeDoc