Add proper method to disable a Feature
This commit is contained in:
parent
b6e75a44b0
commit
826e6272a4
1 changed files with 13 additions and 1 deletions
|
|
@ -53,7 +53,6 @@ public static final function bool IsEnabled()
|
|||
}
|
||||
|
||||
// Enables feature of given class.
|
||||
// To disable a feature simply use 'Destroy'.
|
||||
public static final function Feature EnableMe()
|
||||
{
|
||||
local Feature newInstance;
|
||||
|
|
@ -67,6 +66,18 @@ public static final function Feature EnableMe()
|
|||
return newInstance;
|
||||
}
|
||||
|
||||
public static final function bool DisableMe()
|
||||
{
|
||||
local Feature myself;
|
||||
myself = Feature(GetInstance());
|
||||
if (myself != none)
|
||||
{
|
||||
myself.Destroy();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Event functions that are called when
|
||||
protected function OnEnabled(){}
|
||||
protected function OnDisabled(){}
|
||||
|
|
@ -98,6 +109,7 @@ protected function OnDestroyed()
|
|||
defaultproperties
|
||||
{
|
||||
autoEnable = false
|
||||
DrawType = DT_None
|
||||
// Prevent spawning this feature by any other means than 'EnableMe()'.
|
||||
blockSpawning = true
|
||||
// Features are server-only actors
|
||||
|
|
|
|||
Reference in a new issue