Giter Site home page Giter Site logo

关于Laya.Scene3D的疑惑 about layaair-demo HOT 5 OPEN

lin0102 avatar lin0102 commented on July 30, 2024
关于Laya.Scene3D的疑惑

from layaair-demo.

Comments (5)

ZhengQixv avatar ZhengQixv commented on July 30, 2024

Scene3D是继承自Node的,所以,Scene3D和其他的场景中的节点(比如Sprite3D)没有什么区别,都是一个Node.其次你可以看一下SceneLoad1这个示例,加载的是一个场景文件.ls。在完成加载执行的函数。
sceneLoadFinished(scene){
Laya.stage.addChild(scene);
let camera = scene.getChildByName("Camera");
camera.addComponent(CameraMoveScript);
}
很显然Scene3D是作为Stage的子节点加载到Stage中的。

from layaair-demo.

lin0102 avatar lin0102 commented on July 30, 2024

我是初始化的typescript3D项目,然后照着SceneLoad1写,但会提示property 'Scene3D' does not exist on type typeof 'Laya',是否需要添加其他运行库

from layaair-demo.

lin0102 avatar lin0102 commented on July 30, 2024

我像这么写是可以的——
var scene = Laya.Scene.load("LayaScene_Laya3D01/Laya3D01.ls");
Laya.stage.addChild(scene);
但如果这么写——
Laya.Scene3D.load("LayaScene_Laya3D01/Laya3D01.ls", Laya.Handler.create(null, function (scene) {
Laya.stage.addChild(scene);
}));
就提示没有Scene3D这个属性

from layaair-demo.

ZhengQixv avatar ZhengQixv commented on July 30, 2024

首先Laya.Scene.load是加载2D场景的,Laya.Scene3D.load是加载3D场景的。其次你可以看一下我的截图 ,没有显示你所描述的问题。
image
你可能是用的老版本的IDE我用的是最新的 ,所以 咱们之间可能存在差异,你可以下载一个最新的ide玩玩。

from layaair-demo.

tomerseouxj avatar tomerseouxj commented on July 30, 2024

你动画设置怎么设置的、我的导出来后获取不到weapon挂点,你的角色源文件有么

from layaair-demo.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.