This file contains 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.Collections.Generic; | |
using System.Linq; | |
using Sirenix.OdinInspector; | |
using UnityEngine; | |
using UnityEngine.Rendering; | |
public class MeshCombiner : MonoBehaviour | |
{ | |
[SerializeField, HideInInspector] private MeshRenderer[] meshRenderers; | |
[SerializeField, HideInInspector] private List<GameObject> combinedObjects; |
This file contains 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 FlaxEngine; | |
namespace Game | |
{ | |
/// <summary> | |
/// PlayerMovement Script. | |
/// </summary> | |
public class PlayerMovement : Script | |
{ | |
[Serialize, ShowInEditor] private float _maxWalkSpeed; |
This file contains 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
function doo | |
{ | |
param([int]$amount=8) | |
for($j=0; $j -lt $amount; $j++) { | |
Write-Host "doo " -NoNewLine | |
} | |
Write-Output "" | |
} | |
function printVerse | |
{ |
This file contains 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.Collections.Generic; | |
public static class ServiceRegistry | |
{ | |
// This is a Dictionary (a type of list) of all objects currently registered, by their type | |
private static Dictionary<System.Type, object> _services = new(); | |
// Usage: ServiceRegistry.Register(this) | |
// Please only register one instance of each type |
This file contains 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; | |
public static class Collider2DExtension | |
{ | |
/// <summary> | |
/// Return the closest point on a Collider2D relative to point | |
/// </summary> | |
public static Vector2 ClosestPoint(this Collider2D col, Vector2 point) | |
{ | |
GameObject go = new GameObject("tempCollider"); |
This file contains 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
syntax: glob | |
.DS_Store | |
*.sln | |
*.userprefs | |
*.csproj | |
*.pidb | |
*.unitypackage | |
obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache | |
obj/ |
This file contains 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
Shader "Unlit/NewUnlitShader" | |
{ | |
Properties | |
{ | |
[PerRendererData] _MainTex("Sprite Texture", 2D) = "white" {} | |
_Color("Tint", Color) = (1, 1, 1, 1) | |
[MaterialToggle] PixelSnap("Pixel snap", Float) = 0 | |
_AlphaCutoff("Alpha Cutoff", Range(0.01, 1.0)) = 0.1 | |
} |
This file contains 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
// Put this file in Assets/Editor/ | |
using UnityEngine; | |
using UnityEditor; | |
public class KeywordReplace : UnityEditor.AssetModificationProcessor | |
{ | |
public static void OnWillCreateAsset(string path) | |
{ | |
path = path.Replace(".meta", ""); | |
int index = path.LastIndexOf("."); |
This file contains 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
// Put this file in C:\Program Files\Unity\Editor\Data\Resources\ScriptTemplates and remove this comment line | |
// Requires https://gist.github.com/Wolfos/3eb651879e92cf86c2881243f7f74632 (Remove this comment line too ;) | |
/* | |
#SCRIPTNAME#.cs | |
Created #CREATIONDATE# | |
Project #PROJECTNAME# by #DEVELOPERS# | |
*/ | |
using UnityEngine; | |
namespace #NAMESPACE# |
This file contains 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; | |
public class RigidbodyExtrapolator : MonoBehaviour | |
{ | |
public new Rigidbody rigidbody; | |
void FixedUpdate() | |
{ | |
transform.Translate(-rigidbody.velocity * Time.fixedDeltaTime, Space.World); // Cancel out the force applied by the rigidbody | |
} |