Create a Directory.Build.props
file right next to your .sln
file:
<Project>
<PropertyGroup>
<UnityDllsPath>path_to_unity_installation\Editor\Data\Managed\</UnityDllsPath>
</PropertyGroup>
Caution
Edit the paths to point towards your own installations.
Caution
Some paths use backslashes and others use forward slashes. Take notice of how I have given them below.
.gitconfig
, it is under %homepath%
:[mergetool "unityyamlmerge"]
cmd = "'C:/Program Files/Unity/Hub/Editor/6000.0.28f1/Editor/Data/Tools/UnityYAMLMerge.exe'" merge -p "$BASE" "$REMOTE" "$LOCAL" "$MERGED"
using UnityEngine.EventSystems; | |
using UnityEngine.UI; | |
using UnityEngine; | |
using System.Collections.Generic; | |
[AddComponentMenu("Layout/Parent Aware Content Size Fitter", 141)] | |
[ExecuteAlways] | |
[RequireComponent(typeof(RectTransform))] | |
/// <summary> | |
/// Resizes a RectTransform to fit the size of its content, while also allowing to fill the parent if the content is smaller. |
Add this to .csproj
:
<Target Name="CopyDLL" AfterTargets="Build">
<Message Text="Copying DLL" Importance="High" />
<Copy
SourceFiles="$(TargetDir)$(ProjectName).dll"
DestinationFolder="$(MSBuildProjectDirectory)\relative_target_folder_path_here\"
/>
</Target>
Create a standalone pure C# project.
Create a Directory.Build.props
right alongside your .csproj
file:
<Project>
<PropertyGroup>
<UnityProjectPath>$(MSBuildProjectDirectory)\relative_path_to_unity_project\</UnityProjectPath>
</PropertyGroup>
</Project>
#!/bin/bash | |
shopt -s globstar | |
FILES=(./**/*.*) | |
TOTAL_COUNT=${#FILES[@]} | |
CURRENT_COUNT=1 | |
for i in "${FILES[@]}"; do | |
echo "processing (${CURRENT_COUNT} of ${TOTAL_COUNT}) ${i}" |
using System.Text; | |
using UnityEditor; | |
using UnityEngine; | |
public static class GuidTools | |
{ | |
[MenuItem("Assets/GUID Tools/Log GUIDs")] | |
private static void LogGuids() | |
{ | |
var guids = Selection.assetGUIDs; |
using System; | |
using System.Reflection; | |
using UnityEditor; | |
public static class EditorUtils | |
{ | |
private const BindingFlags AllBindingFlags = (BindingFlags)(-1); | |
/// <summary> | |
/// Returns attributes of type <typeparamref name="TAttribute"/> on <paramref name="serializedProperty"/>. |
using System.Linq; | |
using UnityEngine; | |
using UnityEngine.SceneManagement; | |
public static class SceneExtensions | |
{ | |
/// <summary> | |
/// Returns whether the given scene contains the given component on any of its GameObjects. | |
/// </summary> | |
public static bool HasComponent<T>(this Scene scene) |
using UnityEngine; | |
using UnityEditor; | |
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.IO; | |
[InitializeOnLoad] | |
public class AssetDefinePostprocessor : AssetPostprocessor | |
{ |