-
-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Allowing overrides for virtual commands to call base method (#1944)
* adding override method that calls base * trying to debug instruction for call to base * extra tests * adding tests for client and target Rpc * adding fix for calls to base class Since networkbehaviour parents are processed first we can just fix the method when we see it in SubstituteMethod
- Loading branch information
1 parent
2ce5880
commit b92da91
Showing
7 changed files
with
265 additions
and
0 deletions.
There are no files selected for viewing
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
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
24 changes: 24 additions & 0 deletions
24
Assets/Mirror/Tests/Editor/Weaver/WeaverCommandTests~/OverrideVirtualCallBaseCommand.cs
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,24 @@ | ||
using Mirror; | ||
|
||
|
||
namespace WeaverCommandTests.OverrideVirtualCallBaseCommand | ||
{ | ||
class OverrideVirtualCallBaseCommand : baseBehaviour | ||
{ | ||
[Command] | ||
protected override void CmdDoSomething() | ||
{ | ||
// do somethin | ||
base.CmdDoSomething(); | ||
} | ||
} | ||
|
||
class baseBehaviour : NetworkBehaviour | ||
{ | ||
[Command] | ||
protected virtual void CmdDoSomething() | ||
{ | ||
// do more stuff | ||
} | ||
} | ||
} |