The application provides a method for unity3D three-dimensional scene and webpage element interactive communication, first using nodejs to realize
websocket server, and then using unity3D developer to complete three-dimensional scene effect development according to
product demand, encapsulating interactive actions to be completed by the three-dimensional scene into independent methods, realizing
websocket communication mode supporting webgl platform in unity3D, creating
websocket object, setting up message receiving, sending and closing connection events of websocket connection, and packing to generate webgl end for
web developer, and then encapsulating independent methods for information interactive actions of charts and texts to be displayed in web interface according to
product demand by
web application developer. The method provided by the application can effectively solve the shortcomings of unity3D and
web application element interactive communication, realize decoupling of double-end developers, reduce development communication and debugging difficulty, and effectively solve problems such as high communication cost and inconvenient development debugging in the development process.