'AssetPostprocessor' could not be found

Viewed 57

i was building my game to Xcode , but it;s show an error

"The type or namespace name 'AssetPostprocessor' could not be found (are you missing a using directive or an assembly reference?)"

How can I fix it?

using UnityEngine;
using UnityEditor;

public class importsetting : AssetPostprocessor
{

        void OnPreprocessTexture()
        {

            }
}
1 Answers

AssetPostprocessor is in UnityEditor namespace which is not available in built application (you can use it only in Editor). You should move that script to /Editor directory so it is not included in build.

Related