Skip to content

Instantly share code, notes, and snippets.

@elringus
elringus / BlueprintUtils.cpp
Last active August 29, 2015 14:27
Collection of various blueprint functions.
#include "Saga.h"
#include "BlueprintUtils.h"
FDateTime UBlueprintUtils::StringToDatetime(const FString& dateTimeString)
{
FString modifiedString;
dateTimeString.Split(TEXT("."), &modifiedString, nullptr);
FDateTime dateTime;
FDateTime::ParseIso8601(*modifiedString, dateTime);
Shader "GrabTexBug"
{
Properties
{
[PerRendererData]
_MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
}
SubShader
@elringus
elringus / vgPlayerCollisionTester.cs
Created September 4, 2015 17:37
PlayerCollisionTester
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
using System.Collections;
using System.Collections.Generic;
public class vgPlayerCollisionTester : vgMonoBehaviour
using UnityEditor;
[InitializeOnLoad]
public class AutosaveOnRun
{
static AutosaveOnRun()
{
EditorApplication.playmodeStateChanged = () =>
{
if (EditorApplication.isPlayingOrWillChangePlaymode && !EditorApplication.isPlaying)
@elringus
elringus / AddEndpoints.ps1
Last active January 15, 2016 20:07
A power shell scripts to batch-add end-points to an Azure VM.
Add-AzureAccount
$vm = Get-AzureVM -ServiceName "example-service-name" -Name "example-vm-name"
for ($i=7000; $i -le 7100; $i++)
{
$EndpointName = "EXAMPLE-"
$EndpointName += $i
Add-AzureEndpoint -Name $EndpointName -Protocol "udp" -PublicPort $i -LocalPort $i -VM $vm
}
$vm | Update-AzureVM
using System;
using UnityEngine;
namespace UnityStandardAssets.ImageEffects
{
[ExecuteInEditMode]
[RequireComponent (typeof(Camera))]
[AddComponentMenu ("Image Effects/Other/Screen Overlay")]
public class ScreenOverlay : PostEffectsBase
{
using UnityEngine;
public class #SCRIPTNAME# : MonoBehaviour
{
private void Awake ()
{
}
private void Update ()
@elringus
elringus / Grab.shader
Last active May 8, 2017 10:54
Surf mesh blend mode shader with shadows
Shader "BlendModes/MeshDefault/Grab"
{
Properties
{
_Color("Tint Color", Color) = (1,1,1,1)
_MainTex("Base (RGB)", 2D) = "white" {}
}
SubShader
{
@elringus
elringus / BlendLightedMesh.shader
Created October 31, 2016 21:18
Shader for meshes, which responds to light by applying blend mode effect
Shader "BlendModes/Extra/BlendLightedMesh"
{
Properties
{
_Color ("Tint Color", Color) = (1,1,1,1)
_MainTex ("Base (RGB)", 2D) = "white" {}
_NormalMap ("Normal Map", 2D) = "bump" {}
_BumpDepth ("Bump Depth", Range(0.0, 1.0)) = 1.0
}
Shader "BlendModes/Extra/DirectSurfMesh"
{
Properties
{
_Color("Tint Color", Color) = (1,1,1,1)
_MainTex("Base (RGB)", 2D) = "white" {}
}
SubShader
{