Giter Club home page Giter Club logo

unityassemblies's People

Contributors

rabadash8820 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

unityassemblies's Issues

Feature Request

  1. Automatic detection of Unit Engine location in my machine. If a user has multiple Unity versions it should pick the minimum version.
  2. I want to access ECS functionality in my library.

Allow defining Unity install path by an environment variable

I think it's unreasonable to only allow defining Unity install path by UnityInstallRootPath, it will be hard-coded into the project, since the programs directory can be different from person to person. I suggest we should check an environment variable (UNITY_INSTALL_PATH) at first, and only if it does not exist or somehow incorrect, we would fall back to UnityInstallRootPath.

Incorrect path on Mac

The default path on mac is set to /Application/Unity/Hub/Editor/... however, this is wrong.

The path should be /Applications/Unity/Hub/Editor/... note the 's'. /Application is not a folder:

$ ls /Application | grep Unity
ls: /Application: No such file or directory

$ ls /Applications | grep Unity
Unity Hub.app

This appears to be from here https://github.com/DerploidEntertainment/UnityAssemblies/blob/c81c384f51837d27b811d4b80b2dd824552ae575/nupkg/build/Unity3D.props#L6

Unfortunately adding:

<UnityInstallRoot>/Applications/Unity/Hub/Editor</UnityInstallRoot>

Doesn't fix it because then you get:

warning MSB3106: Assembly strong name "warning MSB3106: Assembly strong name "/Applications/Unity/Hub/Editor/2019.4.15f1/Editor/Data/Managed/UnityEngine.dll" is either a path which could not be found or it is a full assembly name which is badly formed.

Where the correct path is actually:

ls /Applications/Unity/Hub/Editor/2019.4.15f1/Unity.app/Contents/Managed/
ExCSS.Unity.dll
Unity.Cecil.dll
....

Anyway, long story short: sadly, this doesn't really work on macs.

readme.txt bug

The readme.txt that opens automatically has some issues.
It proposes a Directory.Build.props that looks like this:

<Project>
        <UnityProjectPath>path\to\UnityProject</UnityProjectPath>
</Project

when in reality it has to look like this (the readme here on Git is correct):

<Project>
    <PropertyGroup>
        <UnityProjectPath>path\to\UnityProject</UnityProjectPath>
    </PropertyGroup>
</Project>

A > is missing and the PropertyGroup.
At first it didn't load for me, now it does.

Can this be used with github actions ?

I'm trying to build a unity dll in github actions.

Do you know if I can use this to "pull in" the unity dll's so I can build it ?

This is my yaml:

name: Unity Build and Deploy
# on: 
  # workflow_dispatch:
on: push


# OpenID
# https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-amazon-web-services
permissions:
  id-token: write
  contents: read    # This is required for actions/checkout

jobs:
    
  build:
    name: Rowmes World Unity DLL build
    runs-on: windows-latest # ubuntu-latest
    strategy:
      matrix:
        dotnet-version: [ '3.1' ] #[ '3.0', '3.1.x', '5.0.x' ]

    steps:
      - name: Checkout Repository
        uses: actions/checkout@v3
        with:
          lfs: true
          #submodules: true
          submodules: false
          token: ${{secrets.GLOBAL_READ_REPOSITORIES_SECRET}}

      - name: Setup dotnet ${{ matrix.dotnet-version }}
        uses: actions/setup-dotnet@v3
        with:
          dotnet-version: ${{ matrix.dotnet-version }}
      # You can test your matrix by printing the current dotnet version
      - name: Display dotnet version
        run: dotnet --version

      - name: Install dependencies
        run: dotnet restore ./Build/RoamesWorld/RoamesWorld.sln
      - name: Build
        run: dotnet build ./Build/RoamesWorld/RoamesWorld.sln

It's obviously missing the dll -

Does the
run: dotnet restore
restore the dll's using nuget?

Error: D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Build\RoamesWorld\RoamesWorldUtils\AssemblyInfo.cs(16,12): error CS0246: The type or namespace name 'UnityAPICompatibilityVersionAttribute' could not be found (are you missing a using directive or an assembly reference?) [D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Build\RoamesWorld\RoamesWorldUtils\RoamesWorldUtils.csproj]
Error: D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Build\RoamesWorld\RoamesWorldUtils\AssemblyInfo.cs(16,12): error CS0246: The type or namespace name 'UnityAPICompatibilityVersion' could not be found (are you missing a using directive or an assembly reference?) [D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Build\RoamesWorld\RoamesWorldUtils\RoamesWorldUtils.csproj]
Error: D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Assets\Scripts\Utils\UpdateManager.cs(4,19): error CS0234: The type or namespace name 'LowLevel' does not exist in the namespace 'UnityEngine' (are you missing an assembly reference?) [D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Build\RoamesWorld\RoamesWorldUtils\RoamesWorldUtils.csproj]
Error: D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Assets\Scripts\Utils\UpdateManager.cs(5,19): error CS0234: The type or namespace name 'PlayerLoop' does not exist in the namespace 'UnityEngine' (are you missing an assembly reference?) [D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Build\RoamesWorld\RoamesWorldUtils\RoamesWorldUtils.csproj]
Error: D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Assets\Scripts\Utils\MathUtils.cs(25,60): error CS0246: The type or namespace name 'Vector3' could not be found (are you missing a using directive or an assembly reference?) [D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Build\RoamesWorld\RoamesWorldUtils\RoamesWorldUtils.csproj]
Error: D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Assets\Scripts\Utils\MathUtils.cs(25,84): error CS0246: The type or namespace name 'Vector3' could not be found (are you missing a using directive or an assembly reference?) [D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Build\RoamesWorld\RoamesWorldUtils\RoamesWorldUtils.csproj]
Error: D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Assets\Scripts\Utils\MathUtils.cs(25,106): error CS0246: The type or namespace name 'Vector3' could not be found (are you missing a using directive or an assembly reference?) [D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Build\RoamesWorld\RoamesWorldUtils\RoamesWorldUtils.csproj]
Error: D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Assets\Scripts\Utils\MathUtils.cs(25,23): error CS0246: The type or namespace name 'Vector3' could not be found (are you missing a using directive or an assembly reference?) [D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Build\RoamesWorld\RoamesWorldUtils\RoamesWorldUtils.csproj]
Error: D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Assets\Scripts\Utils\MathUtils.cs(231,47): error CS0246: The type or namespace name 'Vector3' could not be found (are you missing a using directive or an assembly reference?) [D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Build\RoamesWorld\RoamesWorldUtils\RoamesWorldUtils.csproj]
Error: D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Assets\Scripts\Utils\MathUtils.cs(231,66): error CS0246: The type or namespace name 'Vector3' could not be found (are you missing a using directive or an assembly reference?) [D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Build\RoamesWorld\RoamesWorldUtils\RoamesWorldUtils.csproj]
Error: D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Assets\Scripts\Utils\MathUtils.cs(231,97): error CS0246: The type or namespace name 'Vector3' could not be found (are you missing a using directive or an assembly reference?) [D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Build\RoamesWorld\RoamesWorldUtils\RoamesWorldUtils.csproj]
Error: D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Assets\Scripts\Utils\MathUtils.cs(231,116): error CS0246: The type or namespace name 'Vector3' could not be found (are you missing a using directive or an assembly reference?) [D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Build\RoamesWorld\RoamesWorldUtils\RoamesWorldUtils.csproj]
Error: D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Assets\Scripts\Utils\MathUtils.cs(329,48): error CS0246: The type or namespace name 'Vector2' could not be found (are you missing a using directive or an assembly reference?) [D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Build\RoamesWorld\RoamesWorldUtils\RoamesWorldUtils.csproj]
Error: D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Assets\Scripts\Utils\MathUtils.cs(329,59): error CS0246: The type or namespace name 'Vector2' could not be found (are you missing a using directive or an assembly reference?) [D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Build\RoamesWorld\RoamesWorldUtils\RoamesWorldUtils.csproj]
Error: D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Assets\Scripts\Utils\MathUtils.cs(329,70): error CS0246: The type or namespace name 'Vector2' could not be found (are you missing a using directive or an assembly reference?) [D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Build\RoamesWorld\RoamesWorldUtils\RoamesWorldUtils.csproj]
Error: D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Assets\Scripts\Utils\MathUtils.cs(329,[81](https://github.com/fugro/power.modelling.roamesworld.legacycore/actions/runs/4051417338/jobs/6969725470#step:6:82)): error CS0246: The type or namespace name 'Vector2' could not be found (are you missing a using directive or an assembly reference?) [D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Build\RoamesWorld\RoamesWorldUtils\RoamesWorldUtils.csproj]
Error: D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Assets\Scripts\Utils\MathUtils.cs(338,35): error CS0246: The type or namespace name 'Vector2' could not be found (are you missing a using directive or an assembly reference?) [D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Build\RoamesWorld\RoamesWorldUtils\RoamesWorldUtils.csproj]
Error: D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Assets\Scripts\Utils\MathUtils.cs(338,47): error CS0246: The type or namespace name 'Vector2' could not be found (are you missing a using directive or an assembly reference?) [D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Build\RoamesWorld\RoamesWorldUtils\RoamesWorldUtils.csproj]
Error: D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Assets\Scripts\Utils\MathUtils.cs(338,59): error CS0246: The type or namespace name 'Vector2' could not be found (are you missing a using directive or an assembly reference?) [D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Build\RoamesWorld\RoamesWorldUtils\RoamesWorldUtils.csproj]
Error: D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Assets\Scripts\Utils\MathUtils.cs(344,49): error CS0246: The type or namespace name 'Vector2' could not be found (are you missing a using directive or an assembly reference?) [D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Build\RoamesWorld\RoamesWorldUtils\RoamesWorldUtils.csproj]
Error: D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Assets\Scripts\Utils\MathUtils.cs(344,60): error CS0246: The type or namespace name 'Vector2' could not be found (are you missing a using directive or an assembly reference?) [D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Build\RoamesWorld\RoamesWorldUtils\RoamesWorldUtils.csproj]
Error: D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Assets\Scripts\Utils\MathUtils.cs(344,71): error CS0246: The type or namespace name 'Vector2' could not be found (are you missing a using directive or an assembly reference?) [D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Build\RoamesWorld\RoamesWorldUtils\RoamesWorldUtils.csproj]
Error: D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Assets\Scripts\Utils\MathUtils.cs(344,[82](https://github.com/fugro/power.modelling.roamesworld.legacycore/actions/runs/4051417338/jobs/6969725470#step:6:83)): error CS0246: The type or namespace name 'Vector2' could not be found (are you missing a using directive or an assembly reference?) [D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Build\RoamesWorld\RoamesWorldUtils\RoamesWorldUtils.csproj]
Error: D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Assets\Scripts\Utils\MathUtils.cs(21,24): error CS0246: The type or namespace name 'Vector2' could not be found (are you missing a using directive or an assembly reference?) [D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Build\RoamesWorld\RoamesWorldUtils\RoamesWorldUtils.csproj]
Error: D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Assets\Scripts\Utils\IGameObject.cs(8,9): error CS0246: The type or namespace name 'Coroutine' could not be found (are you missing a using directive or an assembly reference?) [D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Build\RoamesWorld\RoamesWorldUtils\RoamesWorldUtils.csproj]
Error: D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Assets\Scripts\Utils\MathDouble\Vector3d.cs(180,41): error CS0246: The type or namespace name 'Vector3' could not be found (are you missing a using directive or an assembly reference?) [D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Build\RoamesWorld\RoamesWorldUtils\RoamesWorldUtils.csproj]
Error: D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Assets\Scripts\Utils\MathDouble\Vector3d.cs(414,16): error CS0246: The type or namespace name 'Vector3' could not be found (are you missing a using directive or an assembly reference?) [D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Build\RoamesWorld\RoamesWorldUtils\RoamesWorldUtils.csproj]
Error: D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Assets\Scripts\Utils\MathDouble\Vector3d.cs(419,28): error CS0246: The type or namespace name 'Vector3' could not be found (are you missing a using directive or an assembly reference?) [D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Build\RoamesWorld\RoamesWorldUtils\RoamesWorldUtils.csproj]
Error: D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Assets\Scripts\Utils\MathDouble\Vector3d.cs(126,25): error CS0246: The type or namespace name 'Vector3' could not be found (are you missing a using directive or an assembly reference?) [D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Build\RoamesWorld\RoamesWorldUtils\RoamesWorldUtils.csproj]
Error: D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Assets\Scripts\Utils\MonoHelper.cs(5,31): error CS0246: The type or namespace name 'MonoBehaviour' could not be found (are you missing a using directive or an assembly reference?) [D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Build\RoamesWorld\RoamesWorldUtils\RoamesWorldUtils.csproj]
Error: D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Assets\Scripts\Utils\MonoHelper.cs(7,17): error CS0246: The type or namespace name 'GameObject' could not be found (are you missing a using directive or an assembly reference?) [D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Build\RoamesWorld\RoamesWorldUtils\RoamesWorldUtils.csproj]
Error: D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Assets\Scripts\Utils\UnityGameObject.cs(15,16): error CS0246: The type or namespace name 'Coroutine' could not be found (are you missing a using directive or an assembly reference?) [D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Build\RoamesWorld\RoamesWorldUtils\RoamesWorldUtils.csproj]
Error: D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Assets\Scripts\Utils\UnityGameObject.cs(20,16): error CS0246: The type or namespace name 'MonoBehaviour' could not be found (are you missing a using directive or an assembly reference?) [D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Build\RoamesWorld\RoamesWorldUtils\RoamesWorldUtils.csproj]
Error: D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Assets\Scripts\Utils\UnityGameObject.cs(8,26): error CS0246: The type or namespace name 'MonoBehaviour' could not be found (are you missing a using directive or an assembly reference?) [D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Build\RoamesWorld\RoamesWorldUtils\RoamesWorldUtils.csproj]
Error: D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Assets\Scripts\Utils\UnityGameObject.cs(10,32): error CS0246: The type or namespace name 'MonoBehaviour' could not be found (are you missing a using directive or an assembly reference?) [D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Build\RoamesWorld\RoamesWorldUtils\RoamesWorldUtils.csproj]
Error: D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Assets\Scripts\Utils\UnityHelpers.cs(7,45): error CS0246: The type or namespace name 'MonoBehaviour' could not be found (are you missing a using directive or an assembly reference?) [D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Build\RoamesWorld\RoamesWorldUtils\RoamesWorldUtils.csproj]
Error: D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Assets\Scripts\Utils\MonoHelper.cs(30,46): error CS0246: The type or namespace name 'MonoBehaviour' could not be found (are you missing a using directive or an assembly reference?) [D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Build\RoamesWorld\RoamesWorldUtils\RoamesWorldUtils.csproj]
Error: D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Assets\Scripts\Utils\UpdateManager.cs(18,39): error CS0246: The type or namespace name 'MonoBehaviour' could not be found (are you missing a using directive or an assembly reference?) [D:\a\power.modelling.roamesworld.legacycore\power.modelling.roamesworld.legacycore\Build\RoamesWorld\RoamesWorldUtils\RoamesWorldUtils.csproj]

Build FAILED.

Linux improvements

This doesn't quite work on Linux out-of-the-box.

The problem is that Unity Hub will install Unity into the user's home directory. To work-around this, a csproj / fsproj must have the following:

  <PropertyGroup>
    <TargetFramework>netstandard2.0</TargetFramework>
    <UnityVersion>2019.4.13f1</UnityVersion>
    <UnityInstallRoot>/home/your_username_here/Unity/Hub/Editor/</UnityInstallRoot>
  </PropertyGroup>

The problem with this is that the install root depends on the username, meaning that the project file is not portable between developers.

Would it possible to add a search-path for the user's home directory by default?

Thanks for a great library!

Question: Is it worth using this for mod development

On the face of it this package seems like a good idea, but for mod development I need to reference Assembly-CSharp.dll from an installed game, so I may as well reference the Unity assemblies in the game folder. So would you recommend this for mod dev or not?

In any case I can't work out how to reference this dll.
image

Getting Visual Studio's Live Unit Testing to work?

Here's a quick guide on how to get Live Unit Testing to work when using Unity assemblies.

First step is to decide of a folder in Assets that is to become testable, e.g. Assets/MyProject.

  • in the solution, add a solution folder Tests
  • in that folder, create a NET Standard 2.1 class library in like Projects/MyProject
  • setup its Directory.build.props as follows:
<Project>
	<PropertyGroup>
		<UnityProjectPath>$(SolutionDir)</UnityProjectPath>
	</PropertyGroup>
</Project>
  • setup its .csproj as follows:
<Project Sdk="Microsoft.NET.Sdk">

	<PropertyGroup>
		<TargetFramework>netstandard2.1</TargetFramework>
		<Nullable>enable</Nullable>
		<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
		<LangVersion>9</LangVersion>
	</PropertyGroup>

	<!--enable assertions-->
	<PropertyGroup>
		<DefineConstants>$(DefineConstants);UNITY_ASSERTIONS</DefineConstants>
	</PropertyGroup>

	<ItemGroup>

		<PackageReference Include="Unity3D" Version="2.1.3" />
		
		<!--fix incoming ambiguous references-->
		<Reference Remove="$(UnityEnginePath)" />

		<!--enable assertions-->
		<Reference Include="$(UnityModulesPath)\UnityEngine.CoreModule.dll" Private="True" />

		<!--enable extra stuff-->
		<Reference Include="$(UnityScriptAssembliesPath)\Unity.Mathematics.dll" Private="True" />

		<!--setup project content-->
		<Compile Include="$(SolutionDir)Assets\MyProject\**\*.cs" />

	</ItemGroup>

</Project>
  • reference that new project into your MSTest project
  • things should now work as they usually do for LUT

There are two tricks involved here:

  • referencing files as links, project will sync itself with content in Assets/MyProject
  • Private="True" is what makes LUT to work

If you still run into trouble, try the following steps:

  • close Visual Studio
  • remove C:\Users\USERNAME\source\lut folder, e.g. rd lut /s /q
    • that projected file system sometimes cannot be deleted, just keep trying
  • remove .vs folder in the folder project
  • remove .lutconfig and create a new one from Test/Live Unit Testing/Configure... menu
    • for exclusion, pick Common artifacts eg. bin/, obj/, *.dll, *.obj
  • start LUT again, it should work as expected

Extra notes:

When you add new files, do so in Assets/MyProject, switch to/from Unity so that VS updates/reloads the solution.

.gitignore can be modified like so:

TODO drop here https://github.com/github/gitignore/blob/main/VisualStudio.gitignore

TODO drop here https://github.com/github/gitignore/blob/main/Unity.gitignore

# keep project so it can be referenced by MSTest project (fix Unity.gitignore)
!/**/*.csproj

# but ignore Unity-generated projects at root
/*.csproj

# keep meta for Unity (fix VisualStudio.gitignore)
!/Assets/**/*.meta

# keep Unity packages (fix VisualStudio.gitignore)
!**/[Pp]ackages/*

The result is amazing:

  • use Unity without hardcoding references
  • project is immediately usable within Unity
  • project still works with Live Unit Testing

🥳

Update:

Check this to fix ECall methods must be packaged into a system module.

Could not load file or assembly UnityEngine

I have set up the package according to manual and I can already see UnityEngine.dll hooked up to references in the project. However when I try to create simple unit test with Debug.Log invocation, it ends with an error:
Could not load file or assembly 'UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
Did I forgot about something?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.