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
class DrawInstancedCustomCB : MonoBehaviour | |
{ | |
[SerializeField] private Mesh mesh; | |
[SerializeField] private Material mat; | |
private MaterialPropertyBlock propBlock; | |
private GraphicsBuffer objectToWorlds; | |
void Start() |
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; | |
using UnityEngine.InputSystem; | |
/// <summary> | |
/// Input system wrapper for the new input system. Poorly wraps old system to the new, so you can at least see something | |
/// </summary> | |
public static class Input | |
{ | |
public static bool GetKeyDown(KeyCode key) => Keyboard.current[keyCodeToKey(key)].wasPressedThisFrame; | |
public static bool GetKey(KeyCode key) => Keyboard.current[keyCodeToKey(key)].isPressed; |
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; | |
using UnityEditor; | |
using UnityEngine; | |
using UnityEngine.InputSystem; | |
using System.Linq; | |
class Test : MonoBehaviour | |
{ | |
[SerializeField, Range(0, 1)] private float[] chances = new float[6]; |
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.Reflection; | |
using UnityEditor; | |
using UnityEditor.AssetImporters; | |
using UnityEngine; | |
[CustomEditor(typeof(ModelImporter))] | |
[CanEditMultipleObjects] | |
//https://github.com/Unity-Technologies/UnityCsReference/blob/9034442437e6b5efe28c51d02e978a96a3ce5439/Modules/AssetPipelineEditor/ImportSettings/ModelImporterEditor.cs |
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.Reflection; | |
using UnityEditor; | |
using UnityEditor.Experimental.AssetImporters; | |
using UnityEngine; | |
[CustomEditor(typeof(TextureImporter))] | |
[CanEditMultipleObjects] | |
//https://github.com/Unity-Technologies/UnityCsReference/blob/9034442437e6b5efe28c51d02e978a96a3ce5439/Editor/Mono/ImportSettings/TextureImporterInspector.cs | |
internal class TextureImporterEditor : AssetImporterEditor | |
{ |
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 UnityEditor; | |
using UnityEditor.Experimental.AssetImporters; | |
using UnityEngine; | |
using System.Reflection; | |
using System; | |
using System.Collections; | |
using System.Linq; | |
using Object = UnityEngine.Object; | |
using System.Collections.Generic; |
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
// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) | |
Shader "Sprites/Default" | |
{ | |
Properties | |
{ | |
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {} | |
_Color ("Tint", Color) = (1,1,1,1) | |
_AnimationSpeed ("AnimationSpeed", Vector) = (1,1,0,0) //EDIT: Add speed here | |
[MaterialToggle] PixelSnap ("Pixel snap", Float) = 0 |
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; | |
using UnityEditor; | |
using System.Collections; | |
using System; | |
public class MeshVisualizeWindow : EditorWindow | |
{ | |
[MenuItem("Window/Mesh visualizer")] | |
public static void OpenWindow() | |
{ |