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; | |
public class TTL : MonoBehaviour | |
{ | |
public float AgeLimit; | |
float age; | |
public System.Action<GameObject> Callback; |
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; | |
public class MyScript : MonoBehaviour | |
{ | |
// Always call this to create MyScript objects so we know they are complete. | |
// Never use AddComponent<MyScript>() outside of this class. | |
public static MyScript Create( | |
string resourcesPath, |
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; | |
public class Ballistic : MonoBehaviour | |
{ | |
public Vector3 velocity; | |
void Update () | |
{ | |
velocity += Physics.gravity * Time.deltaTime; |
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; | |
public class MoteSystem : MonoBehaviour | |
{ | |
public Transform target; | |
System.Func<Vector3> GetPlayerVelocity; | |
const float limitDistance = 15.0f; | |
const int BASE_NUM_MOTES = 300; |
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; | |
// @kurtdekker random spawn utilities from my Jetpack Kurt game (And other games) | |
public static class SpawnUtilities | |
{ | |
public static bool ProgressiveLiftAndCastDown( ref Vector3 position, out Vector3 normal) | |
{ | |
Vector3 pos = position; |
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 UnityEngine; | |
// @kurtdekker - delayed-activates things in your scene: | |
// To use: | |
// 1. put this script on fresh blank GameObject | |
// - NOT the same one that you are delayed-activating | |
// - NOT a child of the one(s) you are delayed-activating! | |
// - MAY be above other child GameObjects you activate (eg at top of hierarchy) | |
// 2. set the amount of delay in TimeToDelay field |
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; | |
// @kurtdekker | |
// | |
// from Unity forums: https://forum.unity.com/threads/logic-to-create-turns-of-attacks.1137946/ | |
// | |
// goal: a random attack starts in 2-5 seconds, you have 1 second to defend against it | |
// |
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; | |
// @kurtdekker | |
// | |
// Hyper-cheesy non-aerodynamic flight controls | |
// | |
// To use: | |
// - slap this on your camera |
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; | |
// @kurtdekker | |
// | |
// from Unity forums: https://forum.unity.com/threads/logic-to-create-turns-of-attacks.1137946/ | |
// | |
// Rewriting AttackSequencingDemo as coroutines, as per GroZZler's suggestion. | |
// |
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; | |
// @kurtdekker | |
// | |
// For stopping your game during instantiated / enabled dialogs. | |
// | |
// To use: put this script on things that you want to | |
// stop your game action when they appear, like dialogs. | |
// | |
// You only need one instance of this script per dialog. |