Skip to content

Instantly share code, notes, and snippets.

View rafaelbriet's full-sized avatar

Rafael Briet rafaelbriet

View GitHub Profile
@rafaelbriet
rafaelbriet / GameManager.cs
Created August 10, 2023 14:00
This is the GameManager class of my game "The Adventures of The Lone Bounty Hunter". I used it as an example of a class with multiple responsibilities and practices to be avoided. I detailed these issues in an article published on my blog, where I discuss the importance of writing clean and organized code.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using TMPro;
using UnityEngine;
using UnityEngine.Playables;
using UnityEngine.SceneManagement;
using UnityEngine.Timeline;
using UnityEngine.UI;
@rafaelbriet
rafaelbriet / MultipleObjectsPassIndex.py
Created January 16, 2020 18:58
Apply a "object pass index" to multiple objects in Blender
# COPYRIGHT: https://blenderartists.org/t/applying-object-pass-index-to-multiple-objects/562689/4
# This script apply a object pass index to multiple objects in Blender
# Select all objects to be batched first; all selected objects will be batched
import bpy
selection = bpy.context.selected_objects
passNumber = 2 #change '2' to whichever pass index you choose
bpy.ops.object.select_all(action='DESELECT')
/****************************************************************************************************
Originally created by Kay and published in CodePen (https://codepen.io/opensoorce/pen/KQmvdL).
The original code used jQuery, I just converted to Vanilla JavaScript.
Just to be very clear, this code should not be used in production,
its only purpose is for testing and demos.
****************************************************************************************************/
document.addEventListener("DOMContentLoaded", function() {
let loginSubmit = document.querySelector(".login__submit-btn");