Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

Commit

Permalink
Add support for multiple resource bundles
Browse files Browse the repository at this point in the history
  • Loading branch information
sweetgiorni committed Jul 9, 2022
1 parent 3daf556 commit 5d87392
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 22 deletions.
2 changes: 1 addition & 1 deletion AnyPortal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ private void Awake()
anyPortalAssetBundle = null;
if (Application.platform == RuntimePlatform.WindowsPlayer)
{
anyPortalAssetBundle = AssetBundle.LoadFromMemory(Properties.Resources.anyportal);
anyPortalAssetBundle = AssetBundle.LoadFromMemory(Properties.Resources.anyportalAssetsWin64);
if (!anyPortalAssetBundle)
{
Debug.LogError($"Failed to read AssetBundle stream");
Expand Down
28 changes: 11 additions & 17 deletions AnyPortal.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
Expand All @@ -17,7 +17,7 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<OutputPath>AnyPortalRelease\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
Expand Down Expand Up @@ -68,10 +68,6 @@
<HintPath>libs\Mono.Posix.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Mono.Security">
<HintPath>libs\Mono.Security.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="UnityEngine">
<HintPath>libs\UnityEngine.dll</HintPath>
Expand All @@ -90,9 +86,9 @@
<HintPath>libs\UnityEngine.CoreModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.InputLegacyModule">
<HintPath>..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Valheim\unstripped_corlib\UnityEngine.InputLegacyModule.dll</HintPath>
<Private>False</Private>
<Reference Include="UnityEngine.InputLegacyModule, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>libs\UnityEngine.InputLegacyModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.InputModule">
<HintPath>libs\UnityEngine.InputModule.dll</HintPath>
Expand All @@ -106,14 +102,6 @@
<HintPath>libs\UnityEngine.PhysicsModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.SpriteMaskModule">
<HintPath>..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Valheim\unstripped_corlib\UnityEngine.SpriteMaskModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.SpriteShapeModule">
<HintPath>..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Valheim\unstripped_corlib\UnityEngine.SpriteShapeModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.TerrainModule">
<HintPath>libs\UnityEngine.TerrainModule.dll</HintPath>
<Private>False</Private>
Expand Down Expand Up @@ -143,13 +131,19 @@
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Connected Services\" />
</ItemGroup>
<ItemGroup>
<None Include="AnyPortalUnity\Assets\AssetBundles\anyportal.unitypackage" />
<None Include="AnyPortalUnity\Assets\AssetBundles\Linux64\anyportal.unitypackage" />
<None Include="AnyPortalUnity\Assets\AssetBundles\Win64\anyportal.unitypackage" />
</ItemGroup>
<ItemGroup>
<Content Include="UnityEngine.InputLegacyModule.dll" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
6 changes: 6 additions & 0 deletions AnyPortal.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ VisualStudioVersion = 16.0.31019.35
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AnyPortal", "AnyPortal.csproj", "{11DB1F87-EBE7-49ED-A1A5-A0E31F9159F0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AnyPortalTests", "AnyPortalTests\AnyPortalTests.csproj", "{1EA5CCEB-1738-483C-AB85-056ABA59796E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -15,6 +17,10 @@ Global
{11DB1F87-EBE7-49ED-A1A5-A0E31F9159F0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{11DB1F87-EBE7-49ED-A1A5-A0E31F9159F0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{11DB1F87-EBE7-49ED-A1A5-A0E31F9159F0}.Release|Any CPU.Build.0 = Release|Any CPU
{1EA5CCEB-1738-483C-AB85-056ABA59796E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1EA5CCEB-1738-483C-AB85-056ABA59796E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1EA5CCEB-1738-483C-AB85-056ABA59796E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1EA5CCEB-1738-483C-AB85-056ABA59796E}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
14 changes: 12 additions & 2 deletions Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="anyportal" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\AnyPortalUnity\Assets\AssetBundles\anyportal.unitypackage;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<data name="anyportalAssetsLinux64" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\AnyPortalUnity\Assets\AssetBundles\Linux64\anyportal.unitypackage;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="anyportalAssetsWin64" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\AnyPortalUnity\Assets\AssetBundles\Win64\anyportal.unitypackage;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root>

0 comments on commit 5d87392

Please sign in to comment.