Skip to content

Instantly share code, notes, and snippets.

@Marsgames
Marsgames / GitHub Desktop_en.md
Last active March 11, 2024 10:36
How to use GitHub Dektop?

How to use GitHub with GitHub Desktop

This document was written by and for the teams of Headcrab. It is a guide to help and use Git and GitHub, as well as some best practices followed by the company's collaborators.
It is not exhaustive, and does not replace asking for help from colleagues.


This document was initially intended for internal use only, and was therefore intended for an informed audience. It was to serve as a reminder for developers, and as a knowledge base for other professions (Game Designers, Graphic Designers, QA testers...). It is therefore possible that some information may have been omitted, or that some concepts may be difficult to understand and / or not sufficiently developed here.


@Marsgames
Marsgames / GitCommitUtility.cs
Last active April 15, 2024 07:01
Allow us to get last commit hash from Unity script
using System.IO;
using System;
using System.Diagnostics;
using UnityEditor;
using Debug = UnityEngine.Debug;
public class GitCommitUtility
{
public static string RunGitCommand(string gitCommand)
{
@Marsgames
Marsgames / 01_DrawableDictionaries.MD
Last active April 17, 2024 17:55
Unity scripts to show dictionaries in the inspector

Dictionaries shown in inspector

Render


  • Put DictionaryDrawer.cs into your Assets/Editor folder

  • Put SerializableDictionary.cs into your Scripts folder

  • Create a custom dictionary

[Serializable] public class CustomDictionary : SerializableDictionary { } 
@Marsgames
Marsgames / GitHub Desktop.md
Last active March 11, 2024 11:10
Comment utiliser GitHub Desktop ?

Comment utiliser GitHub à l'aide de GitHub Desktop

Ce document a été rédigé par et pour les équipes de Headcrab. C'est un guide d'aide et d'utilisation de Git et GitHub, ainsi que de certaines bonnes pratiques suivies par les collaborateurs de l'entreprise.
Il n'est pas exhaustif, et ne dispence pas de demander de l'aide à ses collègues.


Ce document avait initialement un usage interne exclusivement, est était donc destiné à un public averti. Il devait servir de rappel pour les développeurs, et de base de connaissance pour les autres métiers (Game Designers, Graphistes, QA testers...). Il est donc possible que certaines informations aient été omises, ou que certains concepts soient compliqués à comprendre et / ou pas assez approfondis ici.


@Marsgames
Marsgames / Guidelines.md
Last active February 15, 2024 09:06
Ce document présente les good practices que nous respectons au sein de Headcrab.

Programmation Guideline

Ce document présente les good practices que nous respectons au sein de Headcrab.

Quand vous clonez un projet Unity OU que vous créez un nouveau projet Unity, vérifiez que le fichier setup.py est présent et exécutez le avant toute chose.

General programming

  • Les noms des classes sont en PascalCase --> class MyClass
  • Les classes de base servant à l'héritage doivent avoir comme suffixe Base --> class PlayerBase
@Marsgames
Marsgames / Utils.cs
Last active October 7, 2020 13:58
Fonctions that can be usefull in all Unity projects (put this file into Assets/Editor folder)
#region Author
/////////////////////////////////////////
// RAPHAEL DAUMAS --> Utils
// https://raphdaumas.wixsite.com/portfolio
// https://github.com/Marsgames
/////////////////////////////////////////
#endregion
using System;
using System.Collections.Generic;
using System.Reflection;
@Marsgames
Marsgames / ICanRewind.cs
Last active November 5, 2020 21:40
A simple system to rewind time like in Prince of Persia
// Source : https://www.twitch.tv/videos/519292916?filter=all&sort=time
#region Author
/////////////////////////////////////////
// RAPHAËL DAUMAS --> ICanRewind
// https://raphdaumas.wixsite.com/portfolio
// https://github.com/Marsgames
/////////////////////////////////////////
#endregion
public interface ICanRewind
@Marsgames
Marsgames / MarioJump.cs
Last active January 31, 2020 17:17
Unity version of Mario jumping physics. If you get jump key down you jump higher than just a press
// Source : https://www.youtube.com/watch?v=7KiK0Aqtmzc
#region Variables
[SerializeField] private float jumpVelocity = 5;
[SerializeField] private float fallOffMultiplier = 2.5f;
[SerializeField] private float lowJumpMultiplier = 2;
private Rigidbody2D rigidbody;
#endregion Variables
@Marsgames
Marsgames / AutoSave.cs
Last active March 24, 2021 10:05
Put it in Assets/Editor. Automaticaly save scene every time you press play
using UnityEditor;
using UnityEngine;
using UnityEditor.SceneManagement;
[InitializeOnLoad, HelpURL("https://forum.unity.com/threads/we-need-auto-save-feature.483853")]
public static class AutoSave
{
/// <summary>
/// Static constructor that gets called when unity fires up.
/// </summary>
@Marsgames
Marsgames / .gitignore
Last active April 21, 2024 05:27
Generic Unity .gitignore (Ignores git, unity, macos, csharp, windows, visualstudio, visualstudiocode)
# Created by https://www.gitignore.io/api/git,unity,macos,csharp,windows,visualstudio,visualstudiocode
# Edit at https://www.gitignore.io/?templates=git,unity,macos,csharp,windows,visualstudio,visualstudiocode
### Csharp ###
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files