hpBg: Laya.MeshSprite3D = null;
hpOffset: Laya.UnlitMaterial = null;
onAwake() {
this.hpBg = this.owner.getChildByName("hp") as Laya.MeshSprite3D;
if (this.hpBg != null) {
this.hpOffset = this.hpBg.meshRenderer.material as Laya.UnlitMaterial;
this.hpOffset.tilingOffsetZ = (1 - this.monsterInfo.hp / this.monsterInfo.maxHp) * 0.5;
}
}
laya里面材质的tilingOffsetZ对应unity材质里面的offset的x














网友评论