This file contains hidden or 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 "Inwards/URP/ClippedOpaque_Matrix_URP_V2" | |
{ | |
Properties | |
{ | |
// Specular vs Metallic workflow | |
[HideInInspector] _WorkflowMode("WorkflowMode", Float) = 1.0 | |
[MainColor] _BaseColor("Color", Color) = (0.5,0.5,0.5,1) | |
[MainTexture] _BaseMap("Albedo", 2D) = "white" {} |
This file contains hidden or 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
#ifndef CLIPPED_OPAQUE | |
#define CLIPPED_OPAQUE | |
#include "VertexHelpers.hlsl" | |
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" | |
#include "Packages/com.unity.render-pipelines.universal/Shaders/LitInput.hlsl" | |
StructuredBuffer<float4x4> matrixBuffer; | |
struct Attributes |
This file contains hidden or 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
// Loop Extensions, but will generate garbage because we'd have to use lambda expressions | |
public static class LoopExtensions { | |
// Ex: (2, 5).ForEach(i => { --do some-action-on-this-elem-- } | |
public static void ForEach(this (int, int) range, Action<int> action) | |
{ | |
for (int i = range.Item1; i < range.Item2; i++) | |
{ | |
action(i); | |
} |
This file contains hidden or 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
public enum Mode : int { | |
ConvertAndDestroy = 0, | |
ConvertAndInjectOriginal = 1 | |
} | |
// Allows you to just create a copy of the asset and convert it. | |
public static void ConstructEntityFromPrefab(string name, string folder, Mode mode, out GameObject src) { | |
src = GetInstantiatedAsset<GameObject>(name, folder).transform.root.gameObject; | |
switch (mode) { | |
case Mode.ConvertAndDestroy: |
This file contains hidden or 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
public class ChargeFXIndicatorSystem : ComponentSystem { | |
private ComponentGroup particleGroup, playerGroup; | |
protected override void OnCreateManager() { | |
particleGroup = GetComponentGroup(ComponentType.ReadOnly<ParticleSystemPair>(), ComponentType.ReadOnly<ID>()); | |
playerGroup = GetComponentGroup(ComponentType.ReadOnly<ChargeShotTimer>(), ComponentType.ReadOnly<ID>()); | |
} | |
protected override void OnUpdate() { |
This file contains hidden or 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
public class ArenaTestFixtures { | |
protected World previousWorld; | |
protected World currentWorld; | |
protected EntityManager entityManager; | |
public RetrievalSystem RetrievalSystem { | |
get => World.Active.GetOrCreateManager<RetrievalSystem>(); | |
} |
This file contains hidden or 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
private ChargeFXIndicatorSystem indicatorSystem; | |
private Entity playerEntity; | |
private ComponentGroup particleGroup, playerGroup; | |
private GameObject particles, player; | |
[SetUp] | |
public override void SetUp() { | |
base.SetUp(); | |
indicatorSystem = currentWorld.GetOrCreateManager<ChargeFXIndicatorSystem>(); | |
particles = GetInstantiatedAsset<GameObject>("ChargeEffect", "Assets/Prefabs"); |
This file contains hidden or 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 UnityEditor; | |
using UnityEngine; | |
public static class PrefabUtils { | |
public static T GetInstantiatedAsset<T>(string searchParams, string folder) where T : Object { | |
var guids = AssetDatabase.FindAssets(searchParams, new [] { folder }); | |
if (guids.Length != 1) { | |
throw new System.InvalidOperationException( | |
$"Found {guids.Length} assets, please narrow down the search result!"); |