Refactor Feature
Make events functions `OnEnabled()` and `OnEnabled()` protected rather than public. Move initialization and clean up logic into `OnCreated()` and `OnDestroyed()` event functions.
This commit is contained in:
parent
dd0bdc8904
commit
3969eb3824
7 changed files with 14 additions and 14 deletions
|
|
@ -65,7 +65,7 @@ var private float updateCooldown;
|
|||
// Recorded game type, to avoid constant conversions every tick
|
||||
var private KFGameType gameType;
|
||||
|
||||
public function OnEnabled()
|
||||
protected function OnEnabled()
|
||||
{
|
||||
gameType = KFGameType(level.game);
|
||||
if (gameType == none)
|
||||
|
|
@ -78,7 +78,7 @@ public function OnEnabled()
|
|||
}
|
||||
}
|
||||
|
||||
public function OnDisabled()
|
||||
protected function OnDisabled()
|
||||
{
|
||||
gameType = KFGameType(level.game);
|
||||
if (gameType != none && disableTick)
|
||||
|
|
|
|||
Reference in a new issue