PostProcessWSA.CheckSafeProjectOverwrite C# (CSharp) Method

CheckSafeProjectOverwrite() public method

public CheckSafeProjectOverwrite ( ) : void
return void
    public override void CheckSafeProjectOverwrite()
    {
        string path = Utility.CombinePath(base.InstallPath, base.VisualStudioName);
        if (Directory.Exists(path))
        {
            string str2 = Utility.CombinePath(path, base.VisualStudioName + ".csproj");
            string str3 = Utility.CombinePath(path, base.VisualStudioName + ".vcxproj");
            string str4 = Utility.CombinePath(path, base.VisualStudioName + ".Shared");
            if (base._sdk != WSASDK.UniversalSDK81)
            {
                if (Directory.Exists(str4))
                {
                    throw new UnityException("Build path contains Universal project which is incompatible with current one.");
                }
            }
            else
            {
                if (!Directory.Exists(str4))
                {
                    if (File.Exists(str2))
                    {
                        throw new UnityException("Build path contains project which is incompatible with current one.");
                    }
                    return;
                }
                path = str4;
                str2 = Utility.CombinePath(path, base.VisualStudioName + ".shproj");
            }
            if (this.UseIL2CPP())
            {
                if (File.Exists(str2))
                {
                    throw new UnityException("Build path contains project built with .NET scripting backend, while current project is using IL2CPP scripting backend.");
                }
            }
            else if (File.Exists(str3))
            {
                throw new UnityException("Build path contains project built with IL2CPP scripting backend, while current project is using .NET scripting backend.");
            }
            if (File.Exists(str2))
            {
                Version projectFileToolsVersion = GetProjectFileToolsVersion(str2);
                Version toolsVersion = this.GetToolsVersion();
                if (projectFileToolsVersion != toolsVersion)
                {
                    throw new UnityException(string.Format("Build path contains project which is incompatible with current one. Expected tools version '{0}', was '{1}'", toolsVersion, projectFileToolsVersion));
                }
            }
        }
    }