Example #1
0
        public static void OnAssemblyLoaded(string path)
        {
            MOD_FOLDER = Path.GetDirectoryName(path).Replace("\\", "/");
            AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;

            Textures.ICON_PATH    = Path.Combine(MOD_FOLDER, "icons").Replace("\\", "/") + "/";
            MESH_PATH             = Path.Combine(MOD_FOLDER, "Meshes").Replace("\\", "/") + "/";
            Textures.TEXTURE_PATH = Path.Combine(MOD_FOLDER, "Textures").Replace("\\", "/") + "/";
            Textures.Albedo       = Path.Combine(Textures.TEXTURE_PATH, "albedo").Replace("\\", "/") + "/";
            Textures.Emissive     = Path.Combine(Textures.TEXTURE_PATH, "emissiveMaskAlpha").Replace("\\", "/") + "/";
            Textures.Height       = Path.Combine(Textures.TEXTURE_PATH, "heightSmoothnessSpecularity").Replace("\\", "/") + "/";
            Textures.Normal       = Path.Combine(Textures.TEXTURE_PATH, "normal").Replace("\\", "/") + "/";

            CivLogger.Log("Found mod in {0}", MOD_FOLDER);
        }
Example #2
0
        private static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
        {
            CivLogger.Log(args.Name);
            try
            {
                if (args.Name.Contains("System.Numerics"))
                {
                    return(Assembly.LoadFile(MOD_FOLDER + "/System.Numerics.dll"));
                }
            }
            catch (Exception ex)
            {
                CivLogger.LogError(ex);
            }

            return(null);
        }