UnityEditor.iOS.Xcode.PBXProject.ContainsFileByProjectPath C# (CSharp) Метод

ContainsFileByProjectPath() публичный Метод

public ContainsFileByProjectPath ( string path ) : bool
path string
Результат bool
        public bool ContainsFileByProjectPath(string path)
        {
            return (this.FindFileGuidByProjectPath(path) != null);
        }

Usage Example

Пример #1
0
    private static void removeCompatibilityLibraryFromProject(XCProject project)
    {
        string folderPath = Path.Combine(Application.dataPath, "Fyber/iOS/fyber-sdk-compat-lib");

        if (Directory.Exists(folderPath))
        {
            Debug.Log(folderPath + " exists. Deleting it");
            Directory.Delete(folderPath, true);
        }

        string libPath = Path.Combine(project.projectRootPath, "Libraries/Fyber/iOS/fyber-sdk-compat-lib");

        if (Directory.Exists(libPath))
        {
            Debug.Log(libPath + " exists. Deleting it");
            Directory.Delete(libPath, true);
        }

#if UNITY_5
        var      compatGroup   = "Libraries/Fyber/iOS/fyber-sdk-compat-lib";
        string[] filesToRemove = { "FYBBannerSize.h", "FYBBannerView.h", "libFyberSDKCompat.a" };

        UnityEditor.iOS.Xcode.PBXProject pbxProject = new UnityEditor.iOS.Xcode.PBXProject();
        string pbxprojPath = UnityEditor.iOS.Xcode.PBXProject.GetPBXProjectPath(project.projectRootPath);
        pbxProject.ReadFromFile(pbxprojPath);

        foreach (string file in filesToRemove)
        {
            var fileToRemove = compatGroup + "/" + file;
            if (pbxProject.ContainsFileByProjectPath(fileToRemove))
            {
                string guid = pbxProject.FindFileGuidByProjectPath(fileToRemove);
                pbxProject.RemoveFile(guid);
            }
        }

        pbxProject.WriteToFile(pbxprojPath);
#endif // UNITY_5
    }
All Usage Examples Of UnityEditor.iOS.Xcode.PBXProject::ContainsFileByProjectPath
PBXProject