Skip to content

Instantly share code, notes, and snippets.

View MarcelvanDuijnDev's full-sized avatar
💭
Learning / Creating

Marcel van Duijn MarcelvanDuijnDev

💭
Learning / Creating
View GitHub Profile
using UnityEngine;
public class AudioZone : MonoBehaviour
{
private enum Options { SetVolume, VolumeOnDistance };
[Header("Type")]
[SerializeField] private Options _Option = Options.SetVolume;
[Header("Target")]
[SerializeField] private Transform _ZoneEffector = null;
@MarcelvanDuijnDev
MarcelvanDuijnDev / ObjectPool.cs
Created August 29, 2022 07:23
Unity Object Pool Handler
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ObjectPool : MonoBehaviour
{
[SerializeField] private ObjectPool_Pool[] _ObjectPools = null;
private List<Transform> _Parents = new List<Transform>();
public static ObjectPool POOL;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Movement_Camera_CutScenes : MonoBehaviour
{
[SerializeField] private List<Movement_Camera_CutScene> _CutScenes = new List<Movement_Camera_CutScene>();
[SerializeField] private LayerMask _TargetLayer;
private int _Current_CutScene;
@MarcelvanDuijnDev
MarcelvanDuijnDev / AudioHandler.cs
Last active May 4, 2023 23:44
Unity Easy multi purpose audio script
using System.Collections;
using System.Collections.Generic;
using UnityEngine.SceneManagement;
using UnityEngine;
using UnityEngine.Audio;
public class AudioHandler : MonoBehaviour
{
[Header("Settings")]
[Tooltip("Only used for testing disable it for the final build to improve performance")]
@MarcelvanDuijnDev
MarcelvanDuijnDev / Clock.cs
Created August 29, 2022 07:06
Unity Clock.cs - Digital/Analog
using System.Collections;
using System.Collections.Generic;
using System;
using UnityEngine;
public class Clock : MonoBehaviour
{
[Header("0,0,0 = SystemTime / else Custom Time")]
public Vector3 CurrentTime_Number;
@MarcelvanDuijnDev
MarcelvanDuijnDev / Pendulum.cs
Created February 14, 2022 15:03
Unity Pendulum script
using UnityEngine;
public class Pendulum : MonoBehaviour
{
[Header("Settings")]
[SerializeField] private float _Speed = 1;
[SerializeField] private float _Distance = 20;
[Header("Offset")]
[SerializeField] private Vector3 _RotationOffset = Vector3.zero;
@MarcelvanDuijnDev
MarcelvanDuijnDev / Tool_QuickStart.cs
Last active September 7, 2023 23:22
Unity Multi purpose Editor Tool (Generate Pre Created scripts / Map Editor / FileFinder / Scene Explorer / Example scenes generator (with scripts automatically applied) and more!)
using System.Collections.Generic;
using System.Collections;
using System.IO;
using System;
using UnityEditor.SceneManagement;
using UnityEditorInternal;
using UnityEditor;
using UnityEngine.SceneManagement;
using UnityEngine.EventSystems;
using UnityEngine.UI;
@MarcelvanDuijnDev
MarcelvanDuijnDev / Movement_RB_FirstPerson.cs
Created January 8, 2022 14:32
Unity Simple First Person Movement for RigidBody
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[RequireComponent(typeof(Rigidbody))]
public class Movement_RB_FirstPerson : MonoBehaviour
{
[Header("Set Refference")]
[SerializeField] private Transform _Head = null;
@MarcelvanDuijnDev
MarcelvanDuijnDev / Movement_FreeCamera.cs
Created January 8, 2022 14:31
Unity Camera Movement - FreeCam
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Movement_FreeCamera : MonoBehaviour
{
[SerializeField] private float _Speed = 5;
[SerializeField] private float _SprintSpeed = 8;
private float _CurrentSpeed;
@MarcelvanDuijnDev
MarcelvanDuijnDev / Movement_Camera.cs
Last active August 29, 2022 07:15
Unity Camera Movement
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Movement_Camera : MonoBehaviour
{
private enum CameraOptionsPos { None, Follow }
private enum CameraOptionsRot { None, Follow }
[Header("Options")]