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 System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
// kurtdekker | |
// A looping downward attack like Angry Birds, Silver: Looping Legend | |
// | |
// To use: | |
// - put this on your Rigidbody2D object | |
// - send it flying |
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 System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
// @kurtdekker | |
// | |
// to use, just drop this onto a blank GameObject located where you want the rings | |
public class StarCastle : 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
using UnityEngine; | |
// @kurtdekker | |
// | |
// An example "level definition" object. | |
// | |
// The purpose is to centralize all the things you need to | |
// present, select and launch a given level. | |
// | |
// To use: |
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 System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
// @kurtdekker | |
// To use: | |
// import a repeating sprite, FullRect | |
// drop it on a SpriteRenderer GameObject | |
// drop this on that same SpriteRenderer you want to be infinitely tiled | |
// |
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; | |
// @kurtdekker | |
// place this on the flashlight, which must have a Light component | |
public class Flashlight : MonoBehaviour | |
{ | |
public float battery = 20; | |
bool isOn; |
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 System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
// @kurtdekker | |
// | |
// This is the statistics accumulator that runs whenever | |
// a game is running in Jetpack Kurt. | |
// | |
// When your game starts call CommonStatisticsAccumulator.Attach() |
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; | |
// @kurtdekker | |
// to use, place this on the GameObject where your Rigidbody2D is located | |
public class SetRB2DCenterOfMass : MonoBehaviour | |
{ | |
public Vector3 DesiredCenterOfMass; | |
void Start () |
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 System.Collections; | |
using UnityEngine; | |
// @kurtdekker | |
// | |
// Simple way to throw visible rays into a scene using LineRenderers | |
// | |
// Useful for debugging raycasts. | |
// | |
// May be helpful to call Debug.Break() simultaneously |
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; | |
// @kurtdekker | |
// drop it in a scene somewhere or else call PossiblyAttach(), | |
// in which case it only attaches in the editor. | |
public class EditorScreenshotTaker : MonoBehaviour | |
{ | |
static bool tried; |
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 System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
// @kurtdekker | |
// | |
// cheap and cheerful repeating keys in Unity3D | |
// | |
// You can lift/release them as fast as you like | |
// and exceed the repeat rate. Or just hold it. |