import * as RE from 'rogue-engine';
import * as THREE from 'three'

export default class TextureSlider extends RE.Component {
  @RE.props.vector2() offsetSpeed:THREE.Vector2 = new THREE.Vector2(0.1, 0.1)
  awake() {

  }

  start() {
  }

  update() {
    if((this.object3d as any).material.map) {
      (this.object3d as any).material.map.offset.x += this.offsetSpeed.x * RE.Runtime.deltaTime;
      (this.object3d as any).material.map.offset.y += this.offsetSpeed.y * RE.Runtime.deltaTime;
    }
  }
}

RE.registerComponent(TextureSlider);
        