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
@MarcelvanDuijnDev
MarcelvanDuijnDev / SaveLoad_JSON.cs
Last active January 8, 2022 16:03
Unity Save/Load JSON files
using System.Collections.Generic;
using System.IO;
using UnityEngine;
public class SaveLoad_JSON : MonoBehaviour
{
private Json_SaveData _SaveData = new Json_SaveData();
void Start()
{
@MarcelvanDuijnDev
MarcelvanDuijnDev / SaveLoad_XML.cs
Created January 8, 2022 14:14
Unity Save/Load XML files
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Xml.Serialization;
using System.IO;
public class SaveLoad_XML : MonoBehaviour
{
private XML_SaveData _SaveData = new XML_SaveData();
@MarcelvanDuijnDev
MarcelvanDuijnDev / ReadWrite_TextFile.cs
Created January 8, 2022 14:18
Unity Read/Write Text(txt) files
using UnityEngine;
using System.IO;
public class ReadWrite_TextFile : MonoBehaviour
{
[SerializeField] private string _Path = "";
[SerializeField] private string _FileName = "ExampleTextFile";
[Header("Example")]
[SerializeField] private string _Message = "Test Message";
@MarcelvanDuijnDev
MarcelvanDuijnDev / Movement_2D_Platformer.cs
Created January 8, 2022 14:26
Unity Simple Movement for 2D Platformer
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[RequireComponent(typeof(Rigidbody2D))]
public class Movement_2D_Platformer : MonoBehaviour
{
[Header("Settings")]
[SerializeField] private float _NormalSpeed = 5;
[SerializeField] private float _SprintSpeed = 8;
@MarcelvanDuijnDev
MarcelvanDuijnDev / Movement_2D_TopDown.cs
Created January 8, 2022 14:27
Unity Simple Movement for 2D TopDown
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[RequireComponent(typeof(Rigidbody2D))]
public class Movement_2D_TopDown : MonoBehaviour
{
[Header("Settings")]
[SerializeField] private float _NormalSpeed = 5;
[SerializeField] private float _SprintSpeed = 8;
@MarcelvanDuijnDev
MarcelvanDuijnDev / Movement_CC_FirstPerson.cs
Last active January 25, 2022 17:13
Unity Simple First Person Movement for Character Controller
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[RequireComponent(typeof(CharacterController))]
public class Movement_CC_FirstPerson : MonoBehaviour
{
[Header("Settings")]
[SerializeField] private float _NormalSpeed = 5;
[SerializeField] private float _SprintSpeed = 8;
@MarcelvanDuijnDev
MarcelvanDuijnDev / Movement_CC_Platformer.cs
Created January 8, 2022 14:28
Unity Simple Platformer Movement for Character Controller
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[RequireComponent(typeof(CharacterController))]
public class Movement_CC_Platformer : MonoBehaviour
{
[Header("Settings")]
[SerializeField] private float _NormalSpeed = 5, _SprintSpeed = 8;
[SerializeField] private float _JumpSpeed = 5;
@MarcelvanDuijnDev
MarcelvanDuijnDev / Movement_CC_TopDown.cs
Created January 8, 2022 14:29
Unity Simple Top Down Movement for Character Controller
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[RequireComponent(typeof(CharacterController))]
public class Movement_CC_TopDown : MonoBehaviour
{
//Movement
[Header("Settings Camera")]
[SerializeField] private Camera _Camera;
@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")]
@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;