/**
 * Created by rockyl on 2019-01-03.
 *
 * 砖块动画单体
 */

import {Entity,} from "scilla";
import TextRenderer from 'components/renderer/TextRenderer'
import Wave from 'components/animation/Wave'
import ScillaComponent from 'components/base/ScillaComponent';

export default class HelloScilla extends ScillaComponent {
	name: string = 'scilla';

	logo: Entity;
	label: Entity;

	private labelRenderer: TextRenderer;
	private logoAnimation: Wave;

	onAwake() {
		super.onAwake();

		console.log('fuck11')

		this.labelRenderer = this.label.getComponent(TextRenderer);
		this.logoAnimation = this.logo.getComponent(Wave);
	}

	tapMe(){
		this.labelRenderer.text = 'Hello ' + this.name;
		this.logoAnimation.play();
	}
}
