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; | |
public static class Helper | |
{ | |
public const float TAU = Mathf.PI * 2; | |
public static float easeInCirc(float x) | |
{ |
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
// This allows a Gameobject to follow the platform its standing on: | |
// useage: | |
// 1. Add this class to a file called IFollowPlatform.cs | |
// 2. In your character controller (or any class that you want to follow a platform), add the interface like I do below | |
// public class RBCharacterController : MonoBehaviour, IFollowPlatform | |
// 3. Add in the following variables to the class | |
// public Transform _prevPlatform { get; set; } | |
// public Vector3 _prevPlatformPosition { get; set; } | |
// public Vector3 _prevLocalPosition { get; set; } | |
// 4. Run this line in Update: |
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.Generic; | |
using UnityEngine; | |
namespace AAI.DIJKSTRA | |
{ | |
public class Dijkstra : MonoBehaviour | |
{ | |
public Node StartNode; | |
public Node GoalNode; |
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; | |
public static class GizmosEx | |
{ | |
// Usage: GizmosEx.DrawWireCircle(position, Quaternion.identity, 1f); | |
public static void DrawWireCircle(Vector3 pos, Quaternion rot, float radius, int detail = 32) | |
{ | |
Vector3[] points3D = new Vector3[detail]; |