Skip to content

Instantly share code, notes, and snippets.

@stevepdp
stevepdp / Rotate.cs
Created May 8, 2023 17:40
A very simple script for rotating a game object on the Y axis
using UnityEngine;
public class Rotator : MonoBehaviour
{
[SerializeField] float rotateSpeed = .25f;
void Update()
{
RotateOnYAxis();
}
@stevepdp
stevepdp / FullscreenManager.cs
Last active May 8, 2023 17:32
A fullscreen manager for Unity projects. With Windows/Linux/macOS exports, I typically have them start in a 720p window so as to be streamer friendly. This script then allows the game to switch from 720p to the user's native resolution and back again. See the ToggleFullScreen method for valid key combos.
#if PLATFORM_STANDALONE
using UnityEngine;
public class FullscreenManager : MonoBehaviour
{
static FullscreenManager instance;
public static FullscreenManager Instance
{
get
{
@stevepdp
stevepdp / ScreenShotter.cs
Last active May 8, 2023 17:41
A screenshot taking tool for Unity. Drop this onto a "ScreenShotter" or similarily named empty object in your scene and configure as desired. The defaults are however pretty good with screenshots being dumped to the top of your project folder every three seconds. Don't forget to exclude this directory in your .gitignore!
#if UNITY_EDITOR
using System.IO;
using UnityEngine;
public class ScreenShotter : MonoBehaviour
{
static ScreenShotter instance;
public static ScreenShotter Instance
{
get
@stevepdp
stevepdp / compile-godot-2.1.4-raspberry-pi-400.md
Last active December 10, 2021 21:48
How to compile Godot 2.1.4 on a Raspberry Pi 400

Compile Godot 2.1.4 on a Raspberry Pi 400

You'll ideally be running an environment that defaults to Python 2. To make things easy, use the recently released Raspberry Pi OS (Legacy) with desktop, which is derived from Debian Buster.

  1. Install dependencies:
    sudo apt install build-essential clang libasound2-dev libgl1-mesa-dev libglu-dev libpulse-dev libssl-dev libssl1.0-dev libudev-dev libx11-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev pkg-config scons yasm

  2. Download the 2.1.4 source from Github, unpack and change into it:
    wget https://github.com/godotengine/godot/archive/refs/tags/2.1.4-stable.tar.gz
    tar xvf 2.1.4-stable.tar.gz

@stevepdp
stevepdp / exporting-godot-documentation.md
Created December 5, 2021 15:12
How to export and view Godot documentation at different points of it's history.

Exporting Godot Documentation

For this example, we're going to build a HTML archive of Godot's documentation at version 2.1.4.

Other versions can be looked up by checking out particular release branches or commits.

Tested on Ubuntu 21.10.

  1. Get sphinx and the readthedocs theme:
    sudo apt install python3-pip