This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Algorithm inspired by https://gist.github.com/Flafla2/1a0b9ebef678bbce3215 | |
| public class PerlinGen | |
| { | |
| private readonly int[] p; // Randomly shuffled array of values from 0 to 255. | |
| // Values are repeated twice to get performance boost | |
| // from avoiding the use of modulo operator. | |
| public PerlinGen(int seed) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 🎮 THE FINALS 🕘 340 hrs 34 mins | |
| 🚓 Grand Theft Auto V Legacy 🕘 268 hrs 22 mins | |
| 🎮 SCP: Secret Laboratory 🕘 159 hrs 45 mins | |
| 🎮 Limbus Company 🕘 157 hrs 47 mins | |
| 🎮 Fall Guys 🕘 96 hrs 27 mins |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using UnityEditor; | |
| using UnityEditor.SceneManagement; | |
| using UnityEngine; | |
| using UnityEngine.SceneManagement; | |
| using UnityToolbarExtender; | |
| /// <summary> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| /* | |
| * Base class for singletons. Inherit from this class to create a monobehavior singleton. | |
| * This is useful for manager classes, main game logic, or any 'static' class that you want handy access to or need monobehavior functionality. | |
| * | |
| * Usage: | |
| * public class SomeManagerClass : Singleton<SomeManagerClass> | |
| * { | |
| * public bool someBool; | |
| * } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static float Noise3D(float x, float y, float z, float frequency, float amplitude, float persistence, int octave, int seed) | |
| { | |
| float noise = 0.0f; | |
| for (int i = 0; i < octave; ++i) | |
| { | |
| // Get all permutations of noise for each individual axis | |
| float noiseXY = Mathf.PerlinNoise(x * frequency + seed, y * frequency + seed) * amplitude; | |
| float noiseXZ = Mathf.PerlinNoise(x * frequency + seed, z * frequency + seed) * amplitude; | |
| float noiseYZ = Mathf.PerlinNoise(y * frequency + seed, z * frequency + seed) * amplitude; |