Skip to content

Instantly share code, notes, and snippets.

View CapelaGames's full-sized avatar

Capela CapelaGames

View GitHub Profile
@CapelaGames
CapelaGames / Helper.cs
Last active April 11, 2024 05:12
Helper Functions for unity
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)
{
@CapelaGames
CapelaGames / IFollowPlatform.cs
Created April 10, 2024 03:00
This allows a Gameobject to follow the platform its standing on:
// 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:
using System.Collections.Generic;
using UnityEngine;
namespace AAI.DIJKSTRA
{
public class Dijkstra : MonoBehaviour
{
public Node StartNode;
public Node GoalNode;
@CapelaGames
CapelaGames / GizmosEx.cs
Last active August 23, 2023 04:54
DrawWireCircle
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];