Drunken Wrestlers 2

Drunken Wrestlers 2

Time Trial
 此主题已被置顶,因此可能具有重要性
Oleg Skutte  [开发者] 2019 年 12 月 26 日 上午 5:51
How to make a map for this gamemode
0) Open this gamemode in editor and add IgnoreObject component to "Gamemode" GameObject

1) Make a map with start and finish

2) Call TimeTrial.StartTimer() when player starts and TimeTrial.Finish() when player finishes.

Example of collision triggered finish script:
using UnityEngine; using DrunkenWrestlers2.Gameplay; public class TimerFinish : MonoBehaviour, IPlayerCollisionHandler { public void OnPlayerCollision(PlayerCollisionData collision) { if(collision.Player==GameplayManager.LocalPlayer) TimeTrial.Finish(); } }
Make sure you ignore everyone but the local player as demonstrated with if(collision.Player==GameplayManager.LocalPlayer) in the code above

3) OPTIONAL:
If your map is failable, you can use TimeTrial.SetCheckpoint() to set a checkpoint and TimeTrial.ToCheckpoint() if a player has failed.

Example of setting a checkpoint:
using UnityEngine; using DrunkenWrestlers2.Gameplay; public class Checkpoint : MonoBehaviour, IPlayerCollisionHandler { public Vector3 offset; public void OnPlayerCollision(PlayerCollisionData collision) { if(collision.Player==GameplayManager.LocalPlayer) TimeTrial.SetCheckpoint(transform.position+offset); } }

4) When uploading to workshop, use this compatibility tag: time01

You can see more examples by opening this map in the editor:
https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=1944652237
最后由 Oleg Skutte 编辑于; 2020 年 2 月 12 日 上午 10:57