heyJordanParker/yaSingleton

Conditional attribute and #ifdef

drdavient opened this issue · 2 comments

Great looking Singleton!

Please excuse my ignorance here, but I'm wondering why you need both the Conditional attribute and the #if defined clause. They seem to replicate one another. I'd love to know :)

cheers

Dave

 ```
    [Conditional("UNITY_EDITOR")]
    public static void AddToPreloadedAssets(this ScriptableObject scriptableObject) {

#if UNITY_EDITOR


https://github.com/jedybg/yaSingleton/blob/afad14d55d759369bb957fc49d8c1ed375ed31d0/Helpers/ScriptableObjectExtensions.cs#L9

Heyo,

It shouldn't be the case, yes, I vaguely remember some issues with Android builds. I'll do some testing & remove the preprocessor directive if it works properly on a more recent version of Unity. The conditional is much cleaner (and takes care of the actual references to the method).

Cheers,
Jordan