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/occlusion_multipass_shader" | |
{ | |
Properties | |
{ | |
[PerRendererData] _MainTex("Sprite Texture", 2D) = "white" {} | |
[PerRendererData] _OcclusionColor("Tint", Color) = (1,0,1,1) | |
} | |
SubShader | |
{ |
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
{ | |
"@type": "Retrodreamer.Monocles.Gen2.Phase", | |
"Id": "base", | |
"Steps": [ | |
{ | |
"@type": "Retrodreamer.Monocles.Gen2.SetParametersStep", | |
"Priority": 0, | |
"Params": { | |
"@type": "Mapgen.GossRix.GossRixParameters", | |
"AreaWidth": 70, |
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
public AnimationCurve _transitionCurve; | |
public IEnumerator MyCustomTransition(Vector3 orig, Vector3 dest, float duration) | |
{ | |
var time = 0.0f; | |
var difference = dest - orig; | |
while (time <= duration) | |
{ | |
var percentage = Mathf.Clamp01(time / duration); | |
var curveValue = _transitionCurve.Evaluate(percentage); | |
var pos = orig + curveValue * difference; |
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
public class ConsoleCommandRouter : MonoBehaviour { | |
void Start () { | |
var repo = ConsoleCommandsRepository.Instance; | |
repo.RegisterCommand("toggle_boolean", ToggleBoolean); | |
} | |
public string ToggleBoolean(params string[] args) { | |
// args is an array of strings representing all the words after "toggle_boolean" on the console line you typed | |
// here is where you'd want to find whatever GameObject or class you'd want to modify and do your thing | |
// might look something like: |
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
// Things I do a lot with lists: | |
// Creation | |
var list = new List<GameObject>(); | |
// Lists resize dynamically as you add content, but if | |
// you roughly know how many elements you plan on having | |
// you can specify a capacity on creation | |
list = new List<GameObject>(200); |
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 System.Collections; | |
using System.Collections.Generic; | |
using System; | |
using System.Reflection; | |
public class SelectPrefabsOfType : EditorWindow { | |
[MenuItem("Window/Prefab Finder")] |
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
var cheerio = require('cheerio'); | |
var request = require('request'); | |
var CronJob = require('cron').CronJob; | |
var url = 'http://www.toysrus.com/product/index.jsp?productId=54369136&prodFindSrc=search&cp='; | |
function showResult(text) { | |
var proc = require('child_process'); | |
if(process.platform === 'darwin') | |
{ |
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
double val; | |
var succeeded = double.TryParse("1.05", out val); | |
Debug.Log("Did parse succeed? " + succeeded + " parsed value is: " + val); |
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
I'm working on a game for #7dfps and I'm at the point where I have basic networking functionality up and running (host game, join game, transition to arena when players have joined, etc). Everything goes great if I have a mac build connect to a mac build, or a windows build connect to a windows build. But I get errors every time I try to connect a mac build to a windows build. I tried windows hosting, mac client & mac hosting, windows client. | |
Windows is version 8.1 64 bit, running a 64 bit development build | |
Mac is version 10.10, running a 64 bit development build | |
Digging into the logs on the mac when it was the client, I found the following information. I verified that I'm seeing similar errors on windows when it acts as the client. Any idea what could cause this? | |
The client is attempting to join the game with the command "open <ip address>" being executed as a console command in blueprints. Previously the host machine would have started listening by opening a map (via a console command in blueprint) with |
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
public interface ICatalogEntry | |
{ | |
string GetName(); | |
} | |
public class Catalog<T> where T : ICatalogEntry | |
{ | |
static Catalog<T> _instance = new Catalog<T>(); |