Skip to content

Instantly share code, notes, and snippets.

View m-biernat's full-sized avatar

Michał Biernat m-biernat

View GitHub Profile
@m-biernat
m-biernat / NoiseGenerationSample.cs
Created March 16, 2024 21:54
A simple height map generator with fractal noise for Unity's terrain
/*
This is a simple implementation of height map generation with fractal noise, and it's compatible with Unity's terrain.
Also, it's a one filer, ready to be copy-pasted into your Unity project and doesn't require any additional libs to run.
Attach NoiseGenerationSample to any GO, add a reference to the Terrain, and pick Generate from the component's context menu.
The code is quite flexible and can be fairly easy modified and adapted to your needs. Check out my GitHub for more :)
Copyright (c) 2024 Michał Biernat @m-biernat, licensed under the MIT License.
*/
using UnityEngine;
@m-biernat
m-biernat / TextureEncoder.cs
Created February 24, 2024 16:19
A class to encode/decode Texture2D and Base64 formats (Unity).
// This is a class to encode/decode Texture2D and Base64 formats (Unity).
// Copyright (c) 2023 Michał Biernat @m-biernat, licensed under the MIT License.
using System;
using UnityEngine;
public static class TextureEncoder
{
public static string Texture2DToBase64(Texture2D texture)
{
@m-biernat
m-biernat / TreeToGameObjectConverter.cs
Created February 24, 2024 16:02
A simple Unity Editor tool that converts trees in a Terrain into GameObjects
// This is a simple Unity Editor tool that converts trees in a Terrain (with multi-terrain support) into GameObjects.
// It should be placed in the Assets/Editor directory. Do not use it without any VCS!
// Copyright (c) 2023 Michał Biernat @m-biernat, licensed under the MIT License.
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
public class TreeToGameObjectConverter : EditorWindow
{
@m-biernat
m-biernat / template-installer.iss
Created January 19, 2024 01:35
A simple installer template for Inno Setup Compiler
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "App"
#define MyAppAuthor "Author"
#define MyAppExeName "App.exe"
#define MyAppVersion "1.0"
#define MyAppOutputName "app-win64-installer"
[Setup]