import { AudioManager, VoiceType } from "../Manager/AudioManager";
import { WXSDK } from "../NetWork/WXSDK";
import { GameManager } from "../Manager/GameManager";

export default class  CoinBehav extends Laya.Script3D{
    constructor(){
        super();
    }
    private _gameobject:Laya.Sprite3D;
    onAwake(){
        this._gameobject = this.owner as Laya.Sprite3D;
        Laya.timer.loop(1,this,this.Rotate);
    }
    OnTouch(){
        GameManager.GoldNum ++ ;
        AudioManager.PlayVoice(VoiceType.coin);
        Laya.timer.clear(this,this.Rotate);
        this.destroy();
    }
    Rotate(){
        this._gameobject.transform.rotate(new Laya.Vector3(0,0.05,0));
    }
}