ScrollTexture.re.js 357 B

12345678910111213
  1. import * as RE from 'rogue-engine'
  2. import * as THREE from 'three'
  3. export default class ScrollTexture extends RE.Component {
  4. @RE.Prop("Vector2") offsetPerTick = new THREE.Vector2(-0.001, 0.001)
  5. @RE.Prop("Material") materialToOffset
  6. update() {
  7. this.materialToOffset.map.offset.add(this.offsetPerTick)
  8. }
  9. }
  10. RE.registerComponent(ScrollTexture);