This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "GameInstanceCommands.h" | |
void UGameInstanceCommands::Initialize(FSubsystemCollectionBase& Collection) | |
{ | |
Super::Initialize(Collection); | |
TestCmd = IConsoleManager::Get().RegisterConsoleCommand( TEXT("LogNetMode"), | |
TEXT("Outputs the net mode to the console."), | |
FConsoleCommandDelegate::CreateUObject( this, &UGameInstanceCommands::LogNetMode ), | |
ECVF_Default ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: Ensure the project is packaged using the "Development" configuration | |
@echo off | |
:: Change dir to the same directory as this batch file | |
cd /d "%~dp0" | |
:: Iterate through all executables in this directory | |
for %%i in (*.exe) do ( | |
:: Run the executable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class PolymorphicSerializationExample : MonoBehaviour | |
{ | |
[SerializeReference] public List<Food> classes = new List<Food>(); | |
#if UNITY_EDITOR | |
private void OnValidate() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Cinemachine; | |
using UnityEngine; | |
public static class MethodExtensions | |
{ | |
public static Vector3 WorldToViewportPoint(this CinemachineVirtualCameraBase vcam, Vector3 position) | |
{ | |
// CyRaid https://forum.unity.com/threads/reproducing-cameras-worldtocameramatrix.365645/ | |
Matrix4x4 worldToCameraMatrix = Matrix4x4.Inverse(Matrix4x4.TRS(vcam.State.FinalPosition, vcam.State.FinalOrientation, new Vector3(1, 1, -1))); | |
Matrix4x4 projectionMatrix = Matrix4x4.Perspective(vcam.State.Lens.FieldOfView, vcam.State.Lens.Aspect, vcam.State.Lens.NearClipPlane, vcam.State.Lens.FarClipPlane); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shader "TextMeshPro/Distance Field-BillboardFacing" | |
{ | |
// Very, very slightly tweaked version. Works in 2022.1.18f1 URP 13.1.8 | |
// Enjoy! | |
// - Jonah | |
// Billboarding version for TextMeshPro (tested in 2018.3), based on default Distance Field shader. | |
// ** Important part is to DISABLE the dynamic batching! (happens in this shader) ** | |
// ...Took a while to figure out that one. |