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 ArcDetect : MonoBehaviour | |
{ | |
[System.Serializable] | |
public class Turret | |
{ |
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
//Properly Lerp between two angles | |
Vector3 AngleLerp(Vector3 StartAngle, Vector3 FinishAngle, float t) | |
{ | |
float xLerp = Mathf.LerpAngle(StartAngle.x, FinishAngle.x, t); | |
float yLerp = Mathf.LerpAngle(StartAngle.y, FinishAngle.y, t); | |
float zLerp = Mathf.LerpAngle(StartAngle.z, FinishAngle.z, t); | |
Vector3 Lerped = new Vector3(xLerp, yLerp, zLerp); | |
return Lerped; | |
} |
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 SetActiveOnEnable : MonoBehaviour { | |
[System.Serializable] | |
public class ObservedObjects | |
{ | |
public GameObject gameObject; |
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 SimpleSteerUtility | |
{ | |
// This is more of an example to show how the interface functions can be used in a very simple manner. | |
// Or, this can be your one-stop shop for a single function call in your Update function. | |
public static void SimpleSteer(ref Quaternion rotation, // ex: transform.rotation | |
ref Transform transform, |
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
struct FPoint { | |
float x; /**< The X coordinate of the point */ | |
float y; /**< The Y coordinate of the point */ | |
}; | |
FPoint steer(const FPoint& target, const FPoint& pos, const FPoint& curForward) { | |
// Direction to target | |
FPoint dir; | |
dir.x = target.x - pos.x; | |
dir.y = target.y - pos.y; |
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; | |
/// <summary> | |
/// This was just a quick-and-dirty tool when inside the Unity Editor. | |
/// Need an Icon on something? Throw this on it, assign a texture (via URI string), done. | |
/// </summary> | |
public class GizmoIcon : MonoBehaviour { | |
public string IconFile; |
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; | |
/// <summary> | |
/// Generates random "clouds" (or whatever you want the prefab to be) along an X-Z plane | |
/// using PerlinNoise. | |
/// </summary> | |
public class CloudGenerator : MonoBehaviour { | |
/// <summary> |