Skip to content

Instantly share code, notes, and snippets.

View david-alejandro-reyes-milian's full-sized avatar
🏠
Working from home

David Reyes david-alejandro-reyes-milian

🏠
Working from home
View GitHub Profile
@david-alejandro-reyes-milian
david-alejandro-reyes-milian / MoveAroundPlatform.cs
Created October 3, 2022 21:30
Moves an object around a 2D platform by using waypoints position and rotation.
using UnityEngine;
namespace Enemies
{
public class MoveAroundPlatform : MonoBehaviour
{
[SerializeField] private float moveSpeed;
[SerializeField] private Transform[] wayPoints;
[SerializeField] public int index;
@david-alejandro-reyes-milian
david-alejandro-reyes-milian / AudioManager.cs
Created July 10, 2022 17:46
Easy to use AudioManager. Creates an audio source connected to an audio output to enable easy audio mixing.
using System;
using System.Collections.Generic;
using UnityEngine;
public class AudioManager : MonoBehaviour
{
private static AudioManager _instance;
public Sound[] sounds;
private readonly Dictionary<string, Sound> _soundDictionary = new Dictionary<string, Sound>();
@david-alejandro-reyes-milian
david-alejandro-reyes-milian / GhostEffect.cs
Created June 29, 2022 20:34
Creates a ghost effect by duplicating the provided GO. Used for dashing commonly.
using System;
using UnityEngine;
public class GhostEffect : MonoBehaviour
{
[SerializeField] private GameObject ghostModel;
private GameObject _ghostModelWithMaterial;
[SerializeField] private GameObject ghostParent;
public float ghostDistance;
public Material ghostMaterial;