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
<?php | |
use craft\elements\Entry; | |
return [ | |
'endpoints' => [ | |
'search.json' => function() { | |
// settings | |
$section_handle = 'articles'; | |
$phrase = Craft::$app->request->getParam('query'); |
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
// by dave @ beesandbombs.tumblr.com >:) | |
void setup() { | |
setup_(); | |
result = new int[width*height][3]; | |
result_ = new int[width*height][3]; | |
} | |
int[][] result, result_; | |
float time; |
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 "Sprites/Cutout" | |
{ | |
Properties | |
{ | |
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {} | |
_Color ("Tint", Color) = (1,1,1,1) | |
[MaterialToggle] PixelSnap ("Pixel snap", Float) = 0 | |
_Cutoff ("Shadow alpha cutoff", Range(0,1)) = 0.5 | |
} |
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 UnityEngine; | |
using System.Collections; | |
public class TimeScaleIndependentParticleSystem : TimeScaleIndependentUpdate | |
{ | |
protected override void Update() | |
{ | |
base.Update(); | |
particleSystem.Simulate(deltaTime, true, false); |
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 UnityEngine; | |
using System.Collections; | |
public class TimeScaleIndependentAnimation : TimeScaleIndependentUpdate | |
{ | |
//inspector fields | |
public bool playOnStart; | |
public string playOnStartStateName; | |
//private fields |
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 UnityEngine; | |
using System.Collections; | |
public class TimeScaleIndependentUpdate : MonoBehaviour | |
{ | |
//inspector fields | |
public bool pauseWhenGameIsPaused = true; | |
//private fields | |
float previousTimeSinceStartup; |
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
/* | |
Tween for Unity by Alec Holowka | |
http://InfiniteAmmo.com - @infinite_ammo | |
*/ | |
using UnityEngine; | |
using System.Collections; | |
public class TweenBase : MonoBehaviour | |
{ |
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
/* | |
InputX for Unity by Alec Holowka | |
WARNING: Work-in-progress! | |
http://InfiniteAmmo.com - @infinite_ammo | |
*/ | |
/* | |
Note: use this code in an editor script to initialize the InputManager asset for use by InputX | |
[MenuItem("X/Setup InputManager Asset")] |
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 override void OnInspectorGUI2() | |
{ | |
// First off, cache a copy of target cast to its type, makes like easier. EXAMPLE | |
AmbientLight light = target as AmbientLight; | |
// This is to top area of the inspector GUI. draw controls here for making chages to parts of the target object that arnt part of the array. | |
light.timeOfDay = EditorGUILayout.Slider("Time of Day", light.timeOfDay, 0, 24); | |
// leave some space to split the main settings from the array | |
EditorGUILayout.Space(); |
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
// attach this to a camera. It sets the sort mode so 2D object are rendered correctly with a perspective camera. | |
public class CameraSortModeSetter : MonoBehaviour | |
{ | |
void Update() | |
{ | |
if (camera != null && camera.transparencySortMode != TransparencySortMode.Orthographic) | |
camera.transparencySortMode = TransparencySortMode.Orthographic; | |
} | |
} |
NewerOlder