Last active
September 21, 2020 08:15
-
-
Save flushpot1125/18a55bcaba3ff85147efb54e5bf8f90b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { UniversalCamera } from "@babylonjs/core"; | |
import {gsap} from "gsap"; | |
import {fromScene} from "../tools"; | |
export default class CameraComponent extends UniversalCamera { | |
@fromScene("cube") | |
private _cube : Mesh; | |
public onStart(): void { | |
var tl = gsap.timeline({repeat: 2, repeatDelay: 1}); | |
tl.to(this.position, {x: 20, duration: 1}); | |
this.lockedTarget = this._cube; | |
// ... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment