-
-
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: calling base method when the first base class did not have the v…
…irtual method (#2014) * adding test for error * adding test with multiple overrides * calling methods in base type * adding test for more than 1 override
- Loading branch information
1 parent
5032ceb
commit 4af72c3
Showing
9 changed files
with
163 additions
and
3 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
1 change: 0 additions & 1 deletion
1
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
27 changes: 27 additions & 0 deletions
27
...itor/Weaver/WeaverCommandTests~/OverrideVirtualCallsBaseCommandWithMultipleBaseClasses.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,27 @@ | ||
using Mirror; | ||
|
||
namespace WeaverCommandTests.OverrideVirtualCallsBaseCommandWithMultipleBaseClasses | ||
{ | ||
class OverrideVirtualCallsBaseCommandWithMultipleBaseClasses : middleBehaviour | ||
{ | ||
[Command] | ||
protected override void CmdDoSomething() | ||
{ | ||
// do somethin | ||
base.CmdDoSomething(); | ||
} | ||
} | ||
|
||
class middleBehaviour : baseBehaviour | ||
{ | ||
} | ||
|
||
class baseBehaviour : NetworkBehaviour | ||
{ | ||
[Command] | ||
protected virtual void CmdDoSomething() | ||
{ | ||
// do more stuff | ||
} | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
...or/Tests/Editor/Weaver/WeaverCommandTests~/OverrideVirtualCallsBaseCommandWithOverride.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,34 @@ | ||
using Mirror; | ||
|
||
namespace WeaverCommandTests.OverrideVirtualCallsBaseCommandWithOverride | ||
{ | ||
class OverrideVirtualCallsBaseCommandWithOverride : middleBehaviour | ||
{ | ||
[Command] | ||
protected override void CmdDoSomething() | ||
{ | ||
// do something | ||
base.CmdDoSomething(); | ||
} | ||
} | ||
|
||
|
||
class middleBehaviour : baseBehaviour | ||
{ | ||
[Command] | ||
protected override void CmdDoSomething() | ||
{ | ||
// do something else | ||
base.CmdDoSomething(); | ||
} | ||
} | ||
|
||
class baseBehaviour : NetworkBehaviour | ||
{ | ||
[Command] | ||
protected virtual void CmdDoSomething() | ||
{ | ||
// do more stuff | ||
} | ||
} | ||
} |
1 change: 0 additions & 1 deletion
1
Assets/Mirror/Tests/Editor/Weaver/WeaverCommandTests~/OverrideVirtualCommand.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