-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
117 additions
and
17 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using TrueSync; | ||
|
||
/// <summary> | ||
/// 销毁离开游戏边界的对象 | ||
/// </summary> | ||
public class SyncedDestoryByBoundary : TrueSyncBehaviour | ||
{ | ||
public void OnSyncedTriggerExit(TSCollision other) | ||
{ | ||
Destroy(other.gameObject); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using TrueSync; | ||
using UnityEngine; | ||
|
||
/// <summary> | ||
/// 匀速移动 | ||
/// </summary> | ||
public class SyncedMover : TrueSyncBehaviour | ||
{ | ||
[SerializeField] private FP speed = 20; | ||
|
||
private TSRigidBody _rigidbody; | ||
|
||
public override void OnSyncedStart() | ||
{ | ||
_rigidbody = GetComponent<TSRigidBody>(); | ||
|
||
if (_rigidbody != null) | ||
{ | ||
_rigidbody.velocity = tsTransform.forward * speed; | ||
} | ||
else | ||
{ | ||
Debug.LogError("Missing TSRigidBody on current GameObject!"); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.