Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SerializationHelper

Class used to help serialization objects

Hierarchy

  • SerializationHelper

Index

Methods

Static AppendSerializedAnimationsSearch playground for AppendSerializedAnimations

  • AppendSerializedAnimations(source: IAnimatable, destination: any): void
  • Appends the serialized animations from the source animations

    Parameters

    • source: IAnimatable

      Source containing the animations

    • destination: any

      Target to store the animations

    Returns void

Static CloneSearch playground for Clone

  • Clone<T>(creationFunction: () => T, source: T): T
  • Clones an object

    Type parameters

    • T

    Parameters

    • creationFunction: () => T

      defines the function used to instanciate the new object

        • (): T
        • Returns T

    • source: T

      defines the source object

    Returns T

    the cloned object

Static InstanciateSearch playground for Instanciate

  • Instanciate<T>(creationFunction: () => T, source: T): T
  • Instanciates a new object based on a source one (some data will be shared between both object)

    Type parameters

    • T

    Parameters

    • creationFunction: () => T

      defines the function used to instanciate the new object

        • (): T
        • Returns T

    • source: T

      defines the source object

    Returns T

    the new object

Static ParseSearch playground for Parse

  • Parse<T>(creationFunction: () => T, source: any, scene: Nullable<Scene>, rootUrl?: Nullable<string>): T
  • Creates a new entity from a serialization data object

    Type parameters

    • T

    Parameters

    • creationFunction: () => T

      defines a function used to instanciated the new entity

        • (): T
        • Returns T

    • source: any

      defines the source serialization data

    • scene: Nullable<Scene>

      defines the hosting scene

    • Optional rootUrl: Nullable<string>

      defines the root url for resources

    Returns T

    a new entity

Static SerializeSearch playground for Serialize

  • Serialize<T>(entity: T, serializationObject?: any): any
  • Static function used to serialized a specific entity

    Type parameters

    • T

    Parameters

    • entity: T

      defines the entity to serialize

    • Optional serializationObject: any

      defines the optional target obecjt where serialization data will be stored

    Returns any

    a JSON compatible object representing the serialization of the entity

Legend

  • Property
  • Method
  • Constructor
  • Property
  • Static method