refactor + lessen stamina usage
This commit is contained in:
@@ -30,16 +30,24 @@ public abstract class CustomPlayerEffect : StatusEffectBase
|
||||
|
||||
_isLoaded = true;
|
||||
|
||||
var playerEffects = NetworkManager.singleton.playerPrefab.GetComponent<ReferenceHub>().playerEffectsController.effectsGameObject.transform;
|
||||
var type = typeof(DisableStaminaRegenEffect);
|
||||
if (!typeof(StatusEffectBase).IsAssignableFrom(type))
|
||||
{
|
||||
Logger.Error($"[CustomPlayerEffect.Initialize] {type.FullName} is not a valid StatusEffectBase and thus could not be registered!");
|
||||
return;
|
||||
}
|
||||
Type[] toLoad =
|
||||
[
|
||||
typeof(DisableStaminaRegenEffect),
|
||||
typeof(BloodFueledStaminaEffect)
|
||||
];
|
||||
|
||||
// register effect into prefab
|
||||
new GameObject(type.Name, type).transform.parent = playerEffects;
|
||||
var playerEffects = NetworkManager.singleton.playerPrefab.GetComponent<ReferenceHub>().playerEffectsController.effectsGameObject.transform;
|
||||
foreach (var type in toLoad)
|
||||
{
|
||||
if (!typeof(StatusEffectBase).IsAssignableFrom(type))
|
||||
{
|
||||
Logger.Error($"[CustomPlayerEffect.Initialize] {type.FullName} is not a valid StatusEffectBase and thus could not be registered!");
|
||||
return;
|
||||
}
|
||||
|
||||
// register effect into prefab
|
||||
new GameObject(type.Name, type).transform.parent = playerEffects;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user