getProperty method

dynamic getProperty(
  1. String propertyName
)

Implementation

dynamic getProperty(String propertyName) {
  if (propertyName == "id") {
    return id;
  } else if (propertyName == "name") {
    return name;
  } else if (propertyName == "scale") {
    return scale;
  } else if (propertyName == "position") {
    return position;
  } else if (propertyName == "quaternion") {
    return quaternion;
  } else if (propertyName == "material") {
    return material;
  } else if (propertyName == "opacity") {
    // opacity 是别的对象的属性 Object3d 直接返回null
    return null;
  } else if (propertyName == "morphTargetInfluences") {
    return morphTargetInfluences;
  } else if (propertyName == "castShadow") {
    return castShadow;
  } else if (propertyName == "receiveShadow") {
    return receiveShadow;
  } else if (propertyName == "visible") {
    return visible;
  } else {
    throw ("Object3D.getProperty type: $type propertyName: $propertyName is not support ");
  }
}