Fix deprecated Feature
file after refactoring
This commit is contained in:
parent
c690572663
commit
4e07eb6c51
@ -68,8 +68,8 @@ public static final function Feature EnableMe()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Event functions that are called when
|
// Event functions that are called when
|
||||||
public function OnEnabled(){}
|
protected function OnEnabled(){}
|
||||||
public function OnDisabled(){}
|
protected function OnDisabled(){}
|
||||||
|
|
||||||
// Set listeners' status
|
// Set listeners' status
|
||||||
private static function SetListenersActiveSatus(bool newStatus)
|
private static function SetListenersActiveSatus(bool newStatus)
|
||||||
@ -82,27 +82,15 @@ private static function SetListenersActiveSatus(bool newStatus)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 'OnEnabled' and 'OnDisabled' should be called from functions that
|
protected function OnCreated()
|
||||||
// will be called regardless of whether 'Feature' was created
|
|
||||||
// with 'ChangeEnabledState' or in some other way.
|
|
||||||
event PreBeginPlay()
|
|
||||||
{
|
{
|
||||||
super.PreBeginPlay();
|
default.blockSpawning = true;
|
||||||
// '!bDeleteMe' means that we will be a singleton instance,
|
SetListenersActiveSatus(true);
|
||||||
// meaning that we only just got enabled.
|
OnEnabled();
|
||||||
if (!bDeleteMe && IsEnabled())
|
|
||||||
{
|
|
||||||
// Block spawning this feature before calling any other events
|
|
||||||
default.blockSpawning = true;
|
|
||||||
SetListenersActiveSatus(true);
|
|
||||||
OnEnabled();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
event Destroyed()
|
protected function OnDestroyed()
|
||||||
{
|
{
|
||||||
super.Destroyed();
|
|
||||||
SetListenersActiveSatus(false);
|
SetListenersActiveSatus(false);
|
||||||
OnDisabled();
|
OnDisabled();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user