class UI_Index extends UIBaseView {
	private timeLabel: eui.Label;
	private bgGroup: eui.Group;
	private horseGroup: eui.Group;
	private obstacleGroup: eui.Group;
	private weatherGroup: eui.Group;

	public constructor() {
		super();
	}

	protected bindEvents(): void {
		super.bindEvents();
	}

	protected onCreate(): void {
		super.onCreate();

		Bg.instance.setBgContainer(this.bgGroup);

		Obstacle.instance.setObstacleContainer(this.obstacleGroup);

		Horse.instance.setHorseContainer(this.horseGroup);

		Weather.instance.setWeatherContainer(this.weatherGroup);

		// setTimeout(function () {
		// 	Weather.instance.startCloud();
		// 	Weather.instance.startRain();
		// 	Weather.instance.startSnow();
		// 	Weather.instance.startWind();
		// }, 5000);
	}

	public renderTimeLabel(timestamp:number):void{
		this.timeLabel.text = Math.ceil(timestamp/ 1000).toString();
	}

	/**
	 * 改变语言时调用
	 */
	protected onLangChange(ev?: egret.Event): void {
		let {Index, Bet } = Lang.instance.lang();
	}

	/**
	 * 界面关闭时调用
	 */
	public onClose(): void {
	}
}