Exemple #1
0
    /// <summary>
    /// Try and remove the SystemModifier to the SystemComponent.
    /// </summary>
    /// <returns>
    /// - ModuleResult.Success if the modifier was remove
    /// - ModuleResult.InvalidSystem if the SystemComponent wasn't found.
    /// </returns>
    public ModuleResult Remove()
    {
        // Try and remove the modifier from the component.
        SystemComponent comp = GetComponent(_componentType) as SystemComponent;

        if (comp)
        {
            comp.RemoveModifier(modifier);
            return(ModuleResult.Success);
        }
        else
        {
            Debug.LogError("[ModifierComponent] Failed to enable, SystemComponent[" + component + "] not found.");
            return(ModuleResult.InvalidSystem);
        }
    }