Optimize code structure for input module.

This commit is contained in:
2023-01-21 17:04:29 +08:00
parent 6779b88055
commit 5198ecec1f
11 changed files with 116 additions and 93 deletions

View File

@@ -12,18 +12,18 @@ namespace Cryville.Common.Unity.Input {
}
}
protected override void ActivateImpl() {
protected override void Activate() {
receiver = new GameObject("__touchrecv__");
receiver.AddComponent<UnityPointerReceiver>().SetHandler(this);
}
protected override void DeactivateImpl() {
protected override void Deactivate() {
if (receiver) GameObject.Destroy(receiver);
}
public override void Dispose(bool disposing) {
if (disposing) {
DeactivateImpl();
Deactivate();
}
}