天天看點

unity 導入動畫到 laya

1、在unity中 animations中,拖入對應的對象到 scene

unity 導入動畫到 laya

2、把對應的動畫檔案拖入對象

unity 導入動畫到 laya

3、部分紋理偏暗

調整下unity中的顔色亮度

unity 導入動畫到 laya

 4、在laya中導入,注意檔案目錄

(1)

this.resource = [

            "res/LayaScene_SampleScene/Conventional/Chick_Animations.lh"

        ]

        Laya.loader.create(this.resource, Laya.Handler.create(this, this.onPreLoadFinish));

(2)使用動畫

var playerSp = Laya.Loader.getRes("res/LayaScene_SampleScene/Conventional/Chick_Animations.lh")

        this.player = this._scene.addChild(playerSp);

        this.player.transform.position = new Laya.Vector3(0,1,-3)

        this.ani= this.player.getComponent(Laya.Animator);

        this.ani.play("Swim/Fly");