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 "Callbacks.h" | |
void CallbackMap::setCallback(const std::string& callbackName, Callback callback) | |
{ | |
map[callbackName] = callback; | |
} | |
CallbackMap::Error CallbackMap::call(const std::string& callbackName, const std::string& args) | |
{ | |
auto iter = map.find(callbackName); |
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 UnityEngine; | |
using UnityEditor; | |
using Cinemachine; | |
using System.Collections.Generic; | |
// To make this work, create an empty MonoBehaviour called "LowFovCameraUtility". | |
// Then, attach that script to your Cinemachine virtual cameras. | |
// If you don't want to use Cinemachine virtual cameras this script should work too, | |
// you'll just need to modify the components and variable names. | |
[CustomEditor(typeof(LowFovCameraUtility))] |
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 UnityEngine; | |
using System.Collections.Generic; | |
[ExecuteInEditMode] | |
public class ModifyColor : MonoBehaviour | |
{ | |
private static MaterialPropertyBlock materialPropertyBlock = null; | |
[SerializeField] | |
private string propertyName = "_Color"; |
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
/* An example UE4 class derived from AActor. It plays a | |
* sound when an actor enters the bounding box, and lets | |
* the player turn a PointLight on and off using the "Use" | |
* key. It originally existed as a blueprint. */ | |
/* WallSconceCpp.h */ | |
#pragma once | |
#include "GameFramework/Actor.h" |
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 "Projector/Solid Projector" { | |
Properties{ | |
_Color("Tint Color", Color) = (1,1,1,1) | |
_ShadowTex("Cookie", 2D) = "gray" {} | |
} | |
Subshader | |
{ | |
Tags {"Queue" = "Transparent" "RenderType" = "Transparent"} | |
Pass | |
{ |
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 "Custom/Rimlight" { | |
Properties { | |
_MainTex ("Base (RGB)", 2D) = "white" {} | |
_RimValue ("Rim value", Range(0, 1)) = 0.5 | |
} | |
SubShader { | |
Tags { "RenderType"="Transparent" "Queue"="Transparent" } | |
CGPROGRAM | |
#pragma surface surf Lambert alpha |
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 UnityEngine; | |
using System.Collections.Generic; | |
using Bolt; | |
using Ludiq; | |
[UnitTitle("Delegate Event")] | |
[SpecialUnit] | |
public class DelegateEventUnit : Unit, IEventUnit, IGraphEventListener, IGraphElementWithData | |
{ | |
public class Data : IGraphElementData |
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
// The functions in this file are used to transform camera-facing billboards into vertical billboards | |
// such that the way the sprite on the billboard is rendered remains the same. | |
// This is done to avoid sorting issues with 3D objects. | |
// This code taken from here: https://forum.unity.com/threads/problem-solving-2d-billboard-sprites-clipping-into-3d-environment.680374/ | |
// Calculates intersection point of ray and plane. | |
float RayPlaneIntersection(float3 rayDir, float3 rayPos, float3 planeNormal, float3 planePos) | |
{ | |
float denom = dot(planeNormal, rayDir); | |
denom = max(denom, 0.000001); // avoid divide by zero |
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; | |
using UnityEditor; | |
// This sorts the triangles within a mesh back-to-front based on Wizgun's fixed camera | |
// angle, solving mesh self-sorting issues when transparent shaders are used. | |
// Normally, these objects are opaque, but when TintedUnlitShaderReveal is swapped in | |
// to reveal what is behind the object, depth sorting is turned off. We need Unity to | |
// draw the mesh in the correct order so that the triangles' depths are respected. |