CN111026365B - App development framework based on Unity3D - Google Patents

App development framework based on Unity3D Download PDF

Info

Publication number
CN111026365B
CN111026365B CN201911094330.0A CN201911094330A CN111026365B CN 111026365 B CN111026365 B CN 111026365B CN 201911094330 A CN201911094330 A CN 201911094330A CN 111026365 B CN111026365 B CN 111026365B
Authority
CN
China
Prior art keywords
interface
module
entity
class
actor
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911094330.0A
Other languages
Chinese (zh)
Other versions
CN111026365A (en
Inventor
袁黎
魏召刚
傅以盘
冀晓霞
李茜
滕凯
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Cubespace Intelligent Technology Co ltd
Original Assignee
Wuhan Cubespace Intelligent Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Cubespace Intelligent Technology Co ltd filed Critical Wuhan Cubespace Intelligent Technology Co ltd
Priority to CN201911094330.0A priority Critical patent/CN111026365B/en
Publication of CN111026365A publication Critical patent/CN111026365A/en
Application granted granted Critical
Publication of CN111026365B publication Critical patent/CN111026365B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design
    • G06F8/24Object-oriented
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention provides an App development framework based on Unity3D, and the method comprises the following steps: the system is composed of a plurality of custom modules injected into a custom FW single instance class by using a polymorphic method, only the FW single instance class needs to be mounted to an editor in the development process, and the plurality of custom modules injected into the FW single instance class do not need to be mounted to a scene independently, so that program operation consumption and misoperation in the mounting process are reduced. The invention has the beneficial effects that: the technical scheme provided by the application decouples the user interface, the three-dimensional display object, the service logic and the data model, improves the development efficiency, and has good expandability and robustness.

Description

App development framework based on Unity3D
Technical Field
The invention relates to the field of software development, in particular to a Unity 3D-based App development framework.
Background
Generally, the Unity3D development is to manually mount the subclass inherited from the monobehavviour onto the GameObject, which includes functional modules, data holding, business logic, interactive logic, model display, rigid bodies, physics, and the like.
The technology is applied to small projects, reusability and development efficiency of codes are improved to a certain extent, but due to high coupling of the codes and the art resources, in the iterative development process of large projects, a Git warehouse conflict is easily caused when a plurality of persons simultaneously edit the same GameObject object or Prefab object, and when the art resources are changed, scripts need to be manually hung again, so that the development efficiency is influenced; a large number of scripts are inherited from the MonoBehavviour, and the integral execution/compiling efficiency of the software is reduced.
Note:
GameObject: game object types defined in the Unity3D engine;
MonoBehavviour: components in the Unity3D engine that can be mounted on GameObject;
prefab: the GameObject preset in the Unity3D engine becomes a prefabricated body and comprises sub game objects, components and data preset by the components;
git: an open source distributed version control system.
Disclosure of Invention
In order to solve the problems, the invention provides a Unity 3D-based App development framework;
an App development framework based on Unity3D is composed of a plurality of custom modules injected into a custom FW single instance by a polymorphic method, the FW single instance is mounted to an editor in the development process, and the plurality of custom modules injected into the FW single instance are not required to be mounted in a scene independently, so that the running consumption of an App program and misoperation in the mounting process are reduced;
the plurality of custom modules comprises: the system comprises a shortcut key module MKey, an interface module MUI, a long connection network module MConn, a command module MCmd, a system module MSystem and an entity module MEntity;
the shortcut key module MKey is used for binding the keyboard keys to the event callback function according to the event name, so that the keyboard keys can be customized conveniently;
the interface module MUI is used for binding an interface class for realizing an IUI interface to an interface prefabricated body resource, automatically loading the corresponding interface prefabricated body resource and completing initialization when an interface class example is loaded, and not needing to mount an interface script to the interface prefabricated body resource;
the long connection network module MConn is used for managing the long connection class for realizing the IConn interface, sending a message to a specified server and receiving a message fed back by the server;
the command module MCmd is used for registering a command class according to a command name and executing a corresponding command;
the system module MSystem is used for registering or removing systems, providing functional API of each system and realizing calling of ICmd interface class; the system is a class for realizing an ISystem interface;
the entity module MEntity is used for injecting an entity factory class to manage all entity objects and assembling or unloading entity components of the entity objects through the factory class; wherein, the entity factory class is a class for realizing an IEntityFactory interface; the entity component is a class for realizing an IComponent interface, holds data required by different functions and can broadcast events of data change;
the use principle of the App development framework based on the Unity3D specifically comprises the following steps:
s101: the quick key module MKey captures user keyboard input, and the interface module MUI captures mouse input or messages received by the long connection network module MConn;
s102: the Unity3D calls the corresponding system injected in the system module MSystem by calling the command injected in the command module MCmd according to the keyboard input, the mouse input or the message received by the network module MConn; wherein the command is a class for realizing an ICmd interface;
s103: a system API function of a corresponding system acquires a required entity through the entity module MEntity, and changes related functional data of the corresponding entity and the entity component; the entity is a class for realizing an IEntity interface;
s104: the entity or the entity component broadcasts the data change event, and all the listeners registered with the data change event execute corresponding callback functions; the listener comprises an interface, an actor and an actor component;
the actor is a class for realizing an IActor interface, the actor component is a class for realizing an IActor component interface, and the interface is a class for realizing an IUI interface.
Further, the FW singleton class is a custom class, and is used for injecting a Unity3D built-in module or injecting a custom module through a schema, and managing all the modules; the mode is a class for realizing an IMode interface;
further, the IMode interface is an interface for initializing the FW singleton class built-in module.
Furthermore, the ICmd interface is a command interface, and is used for implementing class injection of the interface into the MCmd module, and implementing a method for calling a related system;
the ISystem interface is a system interface and is used for realizing the class injection of the interface into the MSystem module and realizing the change of the Entity authority or the related data of the Entity Component;
the IEnity is an Entity interface, is realized by an Entity class in the IEnity, and holds basic data of each Entity; the base data comprises spatial position data, orientation data and scaling data of the entity;
the IComponent interface is an entity component interface, holds data of each function of each entity component, and is used for dispatching events and changing the events;
the IActor interface is an Actor interface, is internally provided with an Actor type to realize the IActor interface and is used for monitoring the change of the Actor data;
the IActorComponent interface is an actor component interface and is used for realizing the display and interaction logic of actors;
the IUI interface is an interface and is used for realizing the interactive logic and data updating of the interface;
the IEntityFacor interface is an entity factory interface and is used for assembling entity components of entity objects;
the IConn interface is a long connection interface and is used for processing the sticky packet and sub-packet of the message packet, encoding and decoding, encrypting and decrypting.
Further, the custom module further comprises:
object pool module MPool: the method is used for registering the object pool according to types or labels, so that the object instance can be reused, and the system garbage recycling consumption is reduced;
a log module MLog: for dividing the log into 5 levels, respectively: debug, info, warn, error, and Fatal;
timer module MTimer: the method is used for inputting the timing duration, repeating times and triggering callback, and simplifies the timing of the default time built in the traditional Unity-based 3D engine.
Further, the custom module further comprises:
the message module MNotice: a callback function for injecting a specified message name, and when a message is dispatched, transmitting data to all callback functions registering the message;
global data module MData: for managing global data in application development;
version update module MVer: the method is used for verifying the versions of the local resources and the server side resources and performing incremental updating on the local resources without downloading the whole program again.
Further, the custom module further comprises:
breakpoint resume module MResume: for downloading files from a server; (ii) a
Scene module MScene: the system is used for managing the loading or unloading of scene files in the Unity3D and binding scene components to game objects in the scene;
audio module MAudio: the system comprises a module, a module and a module, wherein the module is used for encapsulating the audio playing of the Unity3D, setting an audio monitoring object, playing a sound source and setting an audio mixer level setting snapshot;
language localization module MI18N: for configuration by a localized language in a configuration file;
the command recording module MRecorder: recording the execution sequence and time of the commands, and can cancel or redo the commands to reproduce the operations of the user in a serialized mode;
further, the custom module further comprises:
entity component module MComponent: the system is used for managing all entity components and creating or recovering the entity components by using the object pool;
actor module factor: actor component for injecting actor factory class, managing three-dimensional display object, and assembling or disassembling display object through factory class; the actor factory class is a class for realizing an IActorFactory interface; the actor component is a class for realizing an IActorcomponent interface and comprises the display of an art resource model, the interactive processing of a user, the update display of physical attributes and data change events of registered entity components;
actor component module MActorComponent: for managing all actor components.
Further, the IActorFactory interface is an actor factory interface for assembling actor components according to entity objects and entity groups.
The technical scheme provided by the invention has the beneficial effects that: the technical scheme provided by the invention is suitable for serious game application, combines traditional education application and traditional game application, has complex education data structures and service logic, and also has rich UI interaction and three-dimensional graphic display of the game application.
Drawings
The invention will be further described with reference to the accompanying drawings and examples, in which:
FIG. 1 is a structural diagram of a Unity3D based App development framework in an embodiment of the present invention;
FIG. 2 is a flowchart of the general principle of use of a Unity3D based App development framework in an embodiment of the present invention;
fig. 3 is a specific operation diagram in the embodiment of the present invention.
Detailed Description
For a more clear understanding of the technical features, objects and effects of the present invention, embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
The embodiment of the invention provides an App development framework based on Unity 3D; referring to fig. 1, fig. 1 is a structural diagram of an App development framework based on Unity3D in an embodiment of the present invention;
the App development framework based on the Unity3D is formed by injecting a plurality of custom modules into a custom FW single-case class by using a polymorphic method based on the Unity3D, the FW single-case class only needs to be mounted to an editor in the development process, and the plurality of custom modules injected into the FW single-case class do not need to be mounted in a scene independently, so that the program operation consumption and misoperation in the mounting process are reduced;
the method is characterized in that: the plurality of custom modules comprises: the system comprises a shortcut key module MKey, an interface module MUI, a long connection network module MConn, a command module MCmd, a system module MSystem and an entity module MEntity;
the shortcut key module MKey is used for binding the keyboard keys to the event callback function according to the event name, so that the keyboard keys can be customized in application;
the interface module MUI is used for binding an interface class for realizing an IUI interface to an interface prefabricated body resource, automatically loading the corresponding interface prefabricated body resource and completing initialization when an interface class example is loaded, and not needing to mount an interface script to the interface prefabricated body resource;
the long connection network module MConn is used for managing a long connection class for realizing an IConn interface, sending a message to a specified server and receiving a message fed back by the server;
the command module MCmd is used for registering command classes according to command names and executing corresponding commands;
the system module MSystem is used for registering or removing systems and providing functional API of each system, so that call of ICmd interface class is realized conveniently; the system is a class for realizing an ISystem interface;
the entity module MEntity is used for injecting an entity factory class to manage all entity objects and assembling or unloading entity components of the entity objects through the factory class; wherein, the entity factory class is a class for realizing an IEntityFactory interface; the entity component is a class for realizing an IComponent interface, holds data (such as model, parameter, weight, maximum voltage, current, power and the like) required by different functions, and can broadcast events of data change;
referring to fig. 2, fig. 2 is a flowchart illustrating an overall usage principle of an App development framework based on Unity3D in an embodiment of the present invention, which specifically includes the following steps:
s101: the quick key module MKey captures user keyboard input, and the interface module MUI captures mouse input or messages received by the long connection network module MConn;
s102: the Unity3D calls the corresponding system injected in the system module MSystem by calling the command injected in the command module MCmd according to the keyboard input, the mouse input or the message received by the network module MConn; wherein the command is a class for realizing an ICmd interface;
s103: a system API function of a corresponding system acquires a required entity through the entity module MEntity, and changes related functional data of the corresponding entity and the entity component; the entity is a class for realizing an IEntity interface;
s104: the entity or entity component broadcasts the data change event, and all listeners registered with the data change event execute corresponding callback functions (display logic); the listener comprises an interface, an actor and an actor component;
the command does not need to concern about which listeners are affected by changing the data, the interface and the art model are changed or adjusted (namely, actor components) in the actual development process, even the reconstruction is relatively frequent, the original development mode is changed each time, function codes are manually and massively mounted on the interface and other art resources, and then the service logic pointed by the interaction event is set;
the actor is a class realizing an IActor interface, the actor component is a class realizing an IActor component interface, and the interface is a class realizing an IUI interface.
The above interfaces are explained as follows:
the FW singleton class is a self-defined class and is used for injecting a Unity3D built-in module or injecting a self-defined module through a mode and managing all modules; the mode is a class for realizing an IMode interface;
the IMode interface is an interface for initializing an FW single-instance type built-in module;
the ICmd interface is a command interface and is used for realizing the class injection of the interface into the MCmd module and realizing the method for calling the related system;
the ISystem interface is a system interface and is used for realizing the class injection of the interface into the MSystem module and realizing the change of the Entity or the related data of the Entity Component;
the IEnity is an Entity interface, an Entity class is built in to realize the interface, and basic data of the Entity is held; the basic data are the spatial position, direction and scaling of the entity;
the IComponent interface is an entity component interface, holds classification data of an entity and can dispatch event change events;
the IActor interface is an Actor interface, is internally provided with an Actor type to realize the IActor interface, and is used for monitoring the change of the Actor data and updating the basic display;
the IActorComponent interface is an actor component interface and is used for realizing display, interactive logic and the like of actors;
the IUI interface is an interface and is used for realizing the interactive logic and data updating of the interface;
the IEntityFacor interface is an entity factory interface and is used for assembling entity components of entity objects;
the IActorFactory interface is an actor factory interface and is used for assembling actor components according to the entity objects and the entity groups.
The IConn interface is a long connection interface and is used for processing basic functions of message packet sticking, subpackaging, coding, decoding, encrypting, decrypting and the like.
The custom module further comprises:
the thread pool module MThread: based on the C # thread pool encapsulation, the module is used for returning a result to the main thread after computation of service logic (such as a routing algorithm, current and voltage simulation computation and the like) which is relatively time-consuming is completed, so that the frame rate of the main thread is prevented from being reduced;
main thread asynchronous module mangync: batch business logic (such as GameObject, texture2D and other types) of types which cannot be used in the child thread in the Unity3D engine is distributed on the frame for calculation, so that the phenomenon that the frame rate of a main thread is reduced due to overlarge single-frame operation amount is avoided;
object pool module MPool: the object pool is registered according to types or labels, and the object instances can be reused, so that the system garbage recycling consumption is reduced;
a log module MLog: the log is divided into 5 levels, namely Debug, info, warn, error and Fatal; different log classes can be injected (e.g., editor print logs, save text logs, and mail logs);
timer module MTimer: the time duration is input, the number of times of repetition is repeated, and callback is triggered, so that the traditional time-based detaltime timing is simplified;
short-connection module MHttp: the call related to the Http request of Unity is simplified, the response of a server can be simulated, and the test is convenient;
the message module MNotice: a callback function of a specified message name is injected, and when a message is dispatched, data is transmitted to all callback functions for registering the message, so that decoupling of codes is facilitated;
global data module MData: managing global data in management application development;
resource module Masset: loading resources, instantiating resources and the like based on a Unity3D official address resource management system;
version update module MVer: checking the versions of the local resources and the server side resources, and updating in an incremental mode;
breakpoint resume module MResume: the method is mainly used for downloading the files when the server is updated greatly; the resources needing to be updated in the large update are more than or equal to 1G, and the file can be continuously downloaded after the network is disconnected again without re-downloading, so that the flow of the server and the downloading time of a user are saved;
scene module MScene: managing loading \ unloading of scene files (scene) in the Unity3D, binding scene components (scene component) to game objects (GameObject) in a scene, triggering initialization of the scene components after the scene loading is finished, and reducing coupling of scene resources and codes without manually mounting the codes to the scene;
audio module MAudio: encapsulating the audio playing of the Unity3D, setting an audio monitoring object, playing a sound source, and setting an audio mixer level setting snapshot;
language localization module MI18N: the method is suitable for different countries and regions through the localization language configuration in the configuration file;
the command recording module MRecorder: recording the execution sequence and time of the commands, and being capable of canceling/redoing the commands and reproducing the commands in a serialized manner for the operation of the user;
the state machine module MFsm: a main process state of a main state machine control application is built in, and a sub-process state of a sub-state machine control can be defined;
entity component module MComponent: managing all entity components, and creating \ recovering the entity components by using an object pool;
actor module factor: injecting actor factory class, managing three-dimensional display objects, and assembling/unloading actor components of the display objects through the factory class; the actor factory class is a class for realizing an IActorFactory interface; the actor component is a type for realizing an IActorcomponent interface and comprises display of an art resource model, user interaction processing, physical attributes and updating display of data change events of a registered entity component;
actor component module MActorComponent: all actor components are managed.
In the embodiment of the present invention, a technical solution proposed by the present invention is described in detail, taking adding a device to a backpack and dragging a device from the device backpack to three-dimensional scene rendering as an example:
as shown in fig. 3, when a device is added to a backpack, a three-dimensional scene does not need to render the device, but related parameters of the device can be set, and specific business process steps are as follows:
1. a user clicks an add device button on a device library interface, the device library interface class uses an MRecorder recording module to acquire a record class RELementadd (realizing IRecorder interface, a GenertateUndo function returns a lambda expression for deleting the device entity) instance execution record of an add device entity through a command name; the incoming parameters are command name, device id and device type:
var Data = new Data < string, string > { Data0: "device id", data1: "device type" };
FW.Recorder.Record(“elementAdd”,data);
when a program is initialized, an FW (register) method, a BindRecorder (ReleaseAdd >) (ether T) method and a new () method are used in advance, a GenerateUndo method of a ReleaseAdd type example is bound to an 'elementAdd' command name, and a GenerateUndo method is signed; action GenerateUndo (object data), incoming data, returns a lambda expression to undo the command; the IRecorder interface is a command recording interface and is used for command undo and redo, serialization or deserialization;
putting the lambda expression returned by Relementadd. GenerateUndo into a undo stack, and putting the command name and the data into a redo stack;
2. obtaining an add device entity command class CmdElementAdd (implementing an ICmd interface) instance by a command name and executing the command by using an MCmd command module
FW.Cmd.Execute(“elementAdd”,data);
When a program is initialized, a FW, cmd, bindCmdCmd < CmdElementAdd > () where T is ICmd and new () method is used in advance, and an Execute method of CmdElementAdd is bound to the command name of 'elementAdd';
convert command data to required data:
var data=(Data<string,string>)noticeData;
varelementId=data.data0;
varelementType=data.data1;
execute executes the systemmemententity system API, cmdlementadd;
3. acquiring a SystemElementEntity equipment entity system (realizing an ISystem interface) by using an MSystem system module to generate an equipment entity, and adding the equipment entity to an entity list;
FW.System.GetSystem<SystemElementEntity>.AddElement(elementId,elementType);
var entity=FW.Entity.SpawnEntity(elementId,“element”,elementType);
idToEntity.Add(elementId,entity);
4. the Entity module sets Entity basic data, and assembles an equipment Entity by using an injected Entity factory (an Entity factory interface):
var entity=FW.Pool.Spawn<Entity>();
entity.id=elementId;
entity.type=elementType;
factory.AssembleEntity(entity);
5. an EntityFactory entity factory uses a device id and a device type to assemble a device entity;
entity.AddComponent<CElemeentTerminals>();
6. the entity list data of the SystemElementEntity equipment entity system (realizing the ISystem interface) is changed, an event is dispatched to a backpack interface, and the equipment backpack interface is updated and displayed;
7. dragging the backpack equipment to a three-dimensional scene by a mouse, and acquiring a record instance execution record of an actor of the added equipment by using an MRecorder recording module through a command name; a command name and a device id are transmitted; the code is similar to 1;
8. obtaining an actor command instance of the adding equipment by using an MCmd command module through a command name and executing the command; the command name and the equipment id are transmitted; the code is similar to 2;
9. acquiring a SystemElementActor equipment actor system (realizing an ISystem interface) by using an MSystem system module to generate an equipment actor, and adding the equipment actor into an actor list;
FW.System.GetSystem<SystemElementActor>.AddElementActor(elementId,onComplete);
var entity=FW.Entity.GetEntity(elementId);
FW.Actor.SpawnActor(entity,actor=>{
idToActor.Add(elementId,actor);
onComplete(actor);
});
10. the factor module assembles actors using the injected actor factory (implementing the IActorFactory interface):
Factory.SpawnActor(entity,onComplete);
11. the Actor factory loads a resource model and sets Actor basic data, and assembles an equipment Actor by using equipment id:
var path=Paths.GetElementPrefab(entity.type);
FW.Asset.InstantiateAsync(path,go=>{
var actor=go.GetComp<Actor>();
actor.InitEntity(entity);
actor.AddActorComponent<ActorComponentDrag>();
onComplete(actor);
});
12. the entity list data changes and sends an event to a scene component (implementing the ISceneComponent interface) of the scene component of the sceneconventor device, which displays the actor in the scene;
13. when a user presses a Ctrl + Z combination key, the MKey shortcut module triggers a revocation stack of the MRecorder recording module to pop up a last lambda expression and execute:
FW.Recorder.Undo();
14. when the last command is to add the equipment entity, deleting the equipment entity according to the id of the equipment corresponding to the popped lambda expression;
when the last command is to add an equipment actor, deleting the equipment actor according to the id of the equipment corresponding to the popped lambda expression;
15. when a user presses a Ctrl + Y combination key, the MKey shortcut module triggers a redo stack of the MRecorder recording module to pop up the last command name and data, and records the command again:
FW.Recorder.Redo();
16. when the last cancelled command is an add-device entity, a command name, a device id and a device type re-recording command of the popped add-device entity are recorded;
17. when the last revoked command is an add device actor, the add device actor command name pops up and the device id re-records the command.
The beneficial effects of the invention are: the technical scheme provided by the invention is suitable for serious game application, combines traditional education application and traditional game application, has a complex data structure and service logic of education and rich UI (user interface) interaction and three-dimensional graphic display of game application, decouples a user interface, a three-dimensional display object, service logic and a data model, improves development efficiency, and has good expandability and robustness.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and should not be taken as limiting the scope of the present invention, which is intended to cover any modifications, equivalents, improvements, etc. within the spirit and scope of the present invention.

Claims (9)

1. An App development framework based on Unity3D is composed of a plurality of custom modules injected into a custom FW single instance by a polymorphic method, the FW single instance is mounted to an editor in the development process, and the plurality of custom modules injected into the FW single instance are not required to be mounted in a scene independently, so that the running consumption of an App program and misoperation in the mounting process are reduced;
the method is characterized in that: the plurality of custom modules comprises: the system comprises a shortcut key module MKey, an interface module MUI, a long connection network module MConn, a command module MCmd, a system module MSystem and an entity module MEntity;
the shortcut key module MKey is used for binding the keyboard keys to the event callback function according to the event name, so that the keyboard keys can be customized conveniently;
the interface module MUI is used for binding the interface type of the IUI interface to the interface prefabricated body resource, automatically loading the corresponding interface prefabricated body resource and completing initialization when the interface type instance is loaded, and the interface script does not need to be mounted to the interface prefabricated body resource;
the long connection network module MConn is used for managing a long connection class for realizing an IConn interface, sending a message to a specified server and receiving a message fed back by the server;
the command module MCmd is used for registering command classes according to command names and executing corresponding commands;
the system module MSystem is used for registering or removing systems, providing functional API of each system and realizing calling of ICmd interface class; the system is a class for realizing an ISystem interface;
the entity module MEntity is used for injecting an entity factory class to manage all entity objects and assembling or unloading entity components of the entity objects through the factory class; wherein, the entity factory class is a class for realizing an IEntityFactory interface; the entity component is a class for realizing an IComponent interface, holds data required by different functions and can broadcast events of data change;
the use principle of the App development framework based on the Unity3D specifically comprises the following steps:
s101: the quick key module MKey captures user keyboard input, and the interface module MUI captures mouse input or messages received by the long connection network module MConn;
s102: the Unity3D calls the corresponding system injected in the system module MSystem by calling the command injected in the command module MCmd according to the keyboard input, the mouse input or the message received by the network module MConn; wherein the command is a class for realizing an ICmd interface;
s103: a system API function of a corresponding system acquires a required entity through the entity module MEntity, and changes related functional data of the corresponding entity and the entity component; the entity is a class for realizing an IEntity interface;
s104: the entity or the entity component broadcasts the data change event, and all the listeners registered with the data change event execute corresponding callback functions; the listener comprises an interface, an actor and an actor component;
the actor is a class realizing an IActor interface, the actor component is a class realizing an IActor component interface, and the interface is a class realizing an IUI interface.
2. The Unity 3D-based App development framework of claim 1, wherein: the FW singleton class is a custom class and is used for injecting a Unity3D built-in module or injecting a custom module through a mode and managing all modules; the mode is a class that implements an IMode interface.
3. The Unity 3D-based App development framework of claim 2, wherein: the IMode interface is an interface for initializing the FW single-instance type built-in module.
4. The Unity3D based App development framework of claim 1, wherein:
the ICmd interface is a command interface and is used for realizing the class injection of the interface into the MCmd module and realizing the method for calling the related system;
the ISystem interface is a system interface and is used for realizing the class injection of the interface into the MSystem module and realizing the change of the Entity or the related data of the Entity Component;
the IEnity is an Entity interface, is realized by an Entity class in the IEnity, and holds basic data of each Entity; the base data comprises spatial position data, orientation data and scaling data of the entity;
the IComponent interface is an entity component interface, holds data of each function of each entity component, and is used for dispatching events and changing the events;
the IActor interface is an Actor interface, and an Actor class is built in the IActor interface to realize the IActor interface and is used for monitoring the IEntity data change;
the IActorComponent interface is an actor component interface and is used for realizing the display and interaction logic of actors;
the IUI interface is an interface and is used for realizing the interactive logic and data updating of the interface;
the IEntityFacor interface is an entity factory interface and is used for assembling entity components of entity objects;
the IConn interface is a long connection interface and is used for processing the sticky packet and the sub packet of the message packet, encoding and decoding, encrypting and decrypting.
5. The Unity 3D-based App development framework of claim 1, wherein: the custom module further comprises:
object pool module MPool: the method is used for registering the object pool according to types or labels, so that the object instance can be reused, and the system garbage recycling consumption is reduced;
a log module MLog: for dividing the log into 5 levels, respectively: debug, info, warn, error, and Fatal;
timer module MTimer: the method is used for inputting the timing duration, repeating times and triggering callback, and simplifies the timing of the default time built in the traditional Unity-based 3D engine.
6. The Unity 3D-based App development framework of claim 1, wherein: the custom module further comprises:
the message module MNotice: a callback function for injecting a specified message name, and when a message is dispatched, transmitting data to all callback functions registering the message;
global data module MData: for managing global data in application development;
version update module MVer: the method is used for verifying the versions of the local resources and the server side resources and performing incremental updating on the local resources without downloading the whole program again.
7. The Unity 3D-based App development framework of claim 1, wherein: the custom module further comprises:
breakpoint resume module MResume: for downloading files from a server;
scene module MScene: the system is used for managing the loading or unloading of scene files in the Unity3D and binding scene components to game objects in the scene;
audio module MAudio: the system comprises a data processing module, a data processing module and a data processing module, wherein the data processing module is used for packaging an audio play of Unity3D, setting an audio monitoring object, playing a sound source and setting an audio mixer-level setting snapshot;
language localization module MI18N: for configuration by a localized language in a configuration file;
command record module MRecorder: the order and time of execution of the commands are recorded, and the commands can be undone or redone and serialized to reproduce the user's operation.
8. The Unity3D based App development framework of claim 1, wherein: the custom module further comprises:
entity component module MComponent: the system is used for managing all entity components and creating or recovering the entity components by using the object pool;
actor module factor: actor component for injecting actor factory class, managing three-dimensional display object, and assembling or disassembling display object through factory class; the actor factory class is a class for realizing an IActorFactory interface; the actor component is a class for realizing an IActorcomponent interface and comprises the display of an art resource model, the interactive processing of a user, the update display of physical attributes and data change events of registered entity components;
actor component module MActorComponent: for managing all actor components.
9. The Unity 3D-based App development framework of claim 8, wherein: the IActorFactory interface is an actor factory interface and is used for assembling actor components according to the entity objects and the entity groups.
CN201911094330.0A 2019-11-11 2019-11-11 App development framework based on Unity3D Active CN111026365B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911094330.0A CN111026365B (en) 2019-11-11 2019-11-11 App development framework based on Unity3D

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911094330.0A CN111026365B (en) 2019-11-11 2019-11-11 App development framework based on Unity3D

Publications (2)

Publication Number Publication Date
CN111026365A CN111026365A (en) 2020-04-17
CN111026365B true CN111026365B (en) 2023-04-07

Family

ID=70205357

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911094330.0A Active CN111026365B (en) 2019-11-11 2019-11-11 App development framework based on Unity3D

Country Status (1)

Country Link
CN (1) CN111026365B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116954951B (en) * 2023-09-18 2023-11-21 成都数之联科技股份有限公司 Method and system for undoing and redoing based on units

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102855142A (en) * 2012-09-24 2013-01-02 广东华大集成技术有限责任公司 Client architecture based on RIA (rich internet applications) and implementation method thereof
CN103607653A (en) * 2013-11-08 2014-02-26 四川长虹电器股份有限公司 3D model based method for developing television weather dynamic wallpaper
WO2017041655A1 (en) * 2015-09-09 2017-03-16 阿里巴巴集团控股有限公司 Method and apparatus for alerting instant message
CN109493420A (en) * 2018-11-16 2019-03-19 北京华电天仁电力控制技术有限公司 A kind of power plant's three-dimensional visualization methods of exhibiting based on Unity3D
CN109598001A (en) * 2017-09-30 2019-04-09 阿里巴巴集团控股有限公司 A kind of information display method, device and equipment

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7426734B2 (en) * 2003-10-24 2008-09-16 Microsoft Corporation Facilitating presentation functionality through a programming interface media namespace
US20050278708A1 (en) * 2004-06-15 2005-12-15 Dong Zhao Event management framework for network management application development

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102855142A (en) * 2012-09-24 2013-01-02 广东华大集成技术有限责任公司 Client architecture based on RIA (rich internet applications) and implementation method thereof
CN103607653A (en) * 2013-11-08 2014-02-26 四川长虹电器股份有限公司 3D model based method for developing television weather dynamic wallpaper
WO2017041655A1 (en) * 2015-09-09 2017-03-16 阿里巴巴集团控股有限公司 Method and apparatus for alerting instant message
CN109598001A (en) * 2017-09-30 2019-04-09 阿里巴巴集团控股有限公司 A kind of information display method, device and equipment
CN109493420A (en) * 2018-11-16 2019-03-19 北京华电天仁电力控制技术有限公司 A kind of power plant's three-dimensional visualization methods of exhibiting based on Unity3D

Also Published As

Publication number Publication date
CN111026365A (en) 2020-04-17

Similar Documents

Publication Publication Date Title
US7653896B2 (en) Smart UI recording and playback framework
US9286040B2 (en) Software builder
US7165191B1 (en) Automated verification of user interface tests on low-end emulators and devices
CA2604896C (en) System and method of data source detection
US9081579B2 (en) System and method for mobile application development
CN109800135B (en) Information processing method and terminal
CN201392526Y (en) Onboard test system for mobile applications
CN108958708A (en) A kind of software system architecture component-based and software implementation method
CN102999419B (en) A kind of Android test incident record back method and device
CN111651219A (en) Method and equipment for managing multi-module project configuration file
CN111026365B (en) App development framework based on Unity3D
CN109284222B (en) Software unit, project testing method, device and equipment in data processing system
CN114371850A (en) Management method for project construction compiling and code development
US6980916B1 (en) Mechanism for graphical test exclusion
CN112241373A (en) Automatic test method, test device, processor and test system
CN114721647B (en) Object-oriented programming method based on codeless application development
CN115951970A (en) Heterogeneous multi-simulation software integrated development environment
CN115407981A (en) Front-end data mock method and system based on middleware adaptation
CN115061706A (en) Vue3 component state management method, device, equipment and medium
CN111880775A (en) Multi-module layered architecture implementation method and device, electronic equipment and storage medium
CN111124386B (en) Animation event processing method, device, equipment and storage medium based on Unity
CN114063998A (en) Web end modular development method and system, and storage medium
Strittmatter et al. Supplementary material for the evaluation of the layered reference architecture for metamodels to tailor quality modeling and analysis
Lee et al. A Test Automation of a full Software Stack on Virtual Hardware-based simulator
CN115454494A (en) Method, system and medium for implementing content management system based on event stream mechanism

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant