【Editor】
1. Character Editor
2.Automatically format the code when creating a new script
Delete the 'ChangeClothes.ts' script file that comes with the new project by default
Change the New Script button to: New Script, New UI Script
Automatically format the script with the class name of the developer's new file name
Auto-formatted life cycle after new script creation
3. Editor Multilingual Function
4.Main editor UI optimization
5.The editor synchronizes scripts through the refresh function
6.Add the function of locating resources in the local repository to the resource reference control in the property column
7.The editor supports multi-environment login and publishing
Note:
After supporting multiple environments, new projects under the editor will be saved under /MW/Saved/MetaWorld/Projects
If you want to move the project from the old path to the new path, you need to manually delete the tsconfig file in the project, and then compile it and use it normally
8.Added alerts in the local repository for resources with performance risks
9.World/Local Axis Transformation Function
Added world/local axis switching function in Editor toolbar
Toggle object world/local axis with the new function
10.Art resource upload tool (verision three)
Support for prefabricated bodies as standalone resources for tool upload
Support UI as standalone resource for tool upload
Support resource upload number display
11.Static mesh manual merge function
New static model merging function, developers can manually mark static models in groups during editing, and merge them into one static model as a group at runtime, thus reducing drawcall
Instructions
Create a merge object and mount the static model you want to merge under the merge object
Select the static mesh and execute the right-click menu [Include Selected Create Merged Objects].
Merge Effect
Consolidated and unified movement
The merged static model as a whole, if you want to modify the merged static model by code, you need to set the merged object as dynamic
Sample Code
@MWCore.MWClass
export default class test extends MWCore.MWScript
{
protected OnStart(): void {
Events.OnKeyDown(Type.Keys.NumPadOne,()=>
{
let b =MWCore.GameObject.Find("Merge Object ID");
b.location=new Type.Vector(0,0,100);
}
)
}
}
Note
The static model merge function does not support dynamic merge at runtime yet
Developers need to create the merge object at edit time, and the subobjects (StaticMesh) under the merge object will be merged into one at runtime.
After merging, you can drag the code to transform the merged object as a whole, but you can't get the subobjects under the merged object and operate them by the object ID.
There is no practical effect after using the manual merge function under Prefab for the time being, this problem will be fixed as soon as possible.
Other optimization: on the basis of the original static StaticMesh automatic merge batch, add the dynamic StaticMesh DrawCall optimization strategy (multiple identical models in the screen except for transform will be merged into a draw call)
You can see that there are multiple of the same object without increasing drawcall
12. Resource priority loading
13.Editor frame rate limit when losing focus
The editor, which runs at a fixed 62 fps when active, will run at 10 fps when out of focus, reducing PC performance consumption when out of focus
14.Add grid display for surface material, with grid alignment function
After creating a new empty scene, the ground material will show the grid
Large grid corresponds to: move the alignment tool parameter 100,
Compile and mount the script, PIE can run it, or use the role editor for dressing
@MWCore.MWClass
class TestAttach extends MWCore.MWScript {
@MWCore.MWProperty()
preloadAssets = "47666,47673,47668,47669,47671"
Character: GamePlay.Character;
OnStart() {
console.log("OnStart");
GamePlay.AsyncGetCurrentPlayer().then((player) => {
this.Character = player.Character;
this.ChangeCloth();
});
}
ChangeCloth(): void {
this.Character.V2_Tools.UpperCloth_Tools.SetMesh("47673");
this.Character.V2_Tools.LowerCloth_Tools.SetMesh("47666");
this.Character.V2_Tools.FrontHair_Tools.SetMesh("47668");
this.Character.V2_Tools.BehindHair_Tools.SetMesh("47669");
this.Character.V2_Tools.Shoe_Tools.SetMesh("47671");
}
};
export default TestAttach;
2.[Action resource replacement] basic gesture resource replacement
Replaced content.:
Standing standby posture (male/female)
Standing moving posture (male/female)
Jumping stance (male/female)
Flying stance (male/female)
Underwater breaststroke (male/female)
Water Surface freestyle (male/female)
1.New project will use Sakura School 2 character images by default
2.[Humanoid objects] provide collision API between characters and other humanoid objects, allowing users to decide whether to turn on or off collision between characters
/**
* Whether to enable collision with other characters
* @ge
*/
get isCollisionWithOtherCharacter(): boolean;
/**
* Whether to enable collision with other characters
* @set
*/
set isCollisionWithOtherCharacter(inIsCollisionWithOtherCharacter: boolean);
Example effect:
3.[Humanoid Objects] Provide respectively: the client can specify the method to hide other players (without synchronization); the server can hide the specified player
/**
* whether the object is visible
* @get
*/
get isVisible(): boolean;
/**
* whether the object is visible
* @set
*/
set isVisible(inIsVisible: boolean);
/**
* whether the object is visible(local setting)
* @get
*/
get isVisible_Locally(): boolean;
/**
* @set
*/
set isVisible_Locally(inIsVisible: boolean);
4.[Humanoid Object Properties] GroundFriction parameter and SeparateBrakingFriction
/**
* ground friction
* @get
*/
get groundFriction(): number;
/**
* ground friction
* @set
*/
set groundFriction(inGroundFriction: number);
/**
* enable separate friction coefficient
* @get
*/
get bUseSeparateBrakingFriction(): boolean;
/**
* Use separate braking friction
* @set
*/
set bUseSeparateBrakingFriction(inbUseSeparateBrakingFriction: boolean);
5.API-Effects game function object add play completion callback
/*
Non loop effects callback after playback is complete
Loop effects do not support callbacks when playback is complete
*/
_effect.play(()=>{
console.log(`====effect play finished`);
}
6.API-Effects game function object add get time interface
//Get the duration of the effect, in seconds
_effect.getEffectLength():number
7.API-extended navigation interface MoveTo()
/*
1.Support the chararter of using the navigation interface
2.New active abort navigation interface
3.New navigation success callback
4.New navigation to the target point of the stopping range
moveTo(player: MWCore.GameObject, Location: Type.Vector,Radius?:number,OnSuccess?:()=>void,OnFail?:()=>void):void;
*/
@MWCore.MWClass
export default class Move extends MWCore.MWScript {
player: GamePlay.Player;
async onStart() {
if (GamePlay.isClient()) {
this.player = await GamePlay.asyncGetCurrentPlayer();
this.player.Character.OnSkill3Trigger.Add(() => {
this.Move(this.player);
})
this.player.Character.OnSkill4Trigger.Add(() => {
this.Stop(this.player);
})
}
}
//start navigating
@MWCore.MWFunction(MWCore.MWServer)
Move(trigger:MWCore.GameObject,location: Type.Vector) {
GamePlay.moveTo(trigger, location, 5, () => {
console.log("Success");
}, () => {
console.log("Failed!");
});
}
//end navigating
@MWCore.MWFunction(MWCore.MWServer)
Stop(trigger:MWCore.GameObject) {
GamePlay.clearMoveTo(trigger);
}
}
8.API-Rotating axis game function object repair interface function
//Restore the rotation axis to the initial angle
_rotator2.onReverse();
9.TS code standardization
Standardize TS scripting method, lower camel case will be used from now. For code standardization tool usage details, refer to https://gitlab.appshahe.com/metaApp/metaverse/plugins/typescript/-/blob/feature/format1.0/README.md Expose the distance parameter (scaling distance factor) for the near-large-far-small of the world UI
/** Get the distance scaling factor /
get distanceScaleFactor(): number;
/* Set the distance scaling factor */
set distanceScaleFactor(Value: number);
10.Resolved the skyhbox cloud stretching, and incorrect parameters and other issues
11.Throwing objects support dynamic modification of speed direction
Before change: Can't change the direction dynamically after Launch
After change: you can dynamically change the direction after Launch
Example:
this.projectile.Launch();
setTimeout(()=>{
this.projectile.rotation = changeRot;
this.projectile.InitailSpeed = changeSpeed;
},changeTime)
12.Mobile client version verification and connection exception prompt
13.Loading page secondary optimization and Mobile end prompt box UI change
Optimize the background image of the loading page and the performance and text of the progress tips below
Optimize pop-up alert box UI
The above right figure is just a reference, the actual matching process will not pop up "Cancel Match"
14.Mobile side adds the function of switching multiple languages according to the system language
1.JS listening port fixed, easy to debug code directly in the IDE
server fixed por: 23300
Client fixed ports: 23301-23304 are four clients
2.Transform retains two decimal places for precision
3.API - New dynamic creation and deletion of scripts, and can be mounted on the GameObject
// can also create with ID
// MWCore.MWScript.spawnScript("Script ID");
// Create Script
let _script = await MWCore.MWScript.spawnScript(Test01);
_script.setTarget(this.obj);
// Delete Script
_script.destroy();
4.On-demand loading function for role modules
Resources used through the Role Editor or the Role Editor API do not need to be preloaded
/*Set the upper cloth resource, referencing the resource GUID without preload*/
GamePlay.GetCurrentPlayer().Character.V2_Tools.UpperCloth_Tools.SetMesh("Resource GUID")