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; | |
public class Program | |
{ | |
public static void Main() | |
{ | |
int myInt = 5; | |
TestValue<float> testValue = new TestValue<float>(); | |
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 MyElement : VisualElement | |
{ | |
static readonly CustomStyleProperty<int> k_CellSizeProperty = new CustomStyleProperty<int>("--cell-size"); | |
static readonly CustomStyleProperty<Color> k_OddCellColorProperty = new CustomStyleProperty<Color>("--odd-cell-color"); | |
static readonly CustomStyleProperty<Color> k_EvenCellColorProperty = new CustomStyleProperty<Color>("--even-cell-color"); | |
int m_CellSize; | |
Color m_OddCellColor; | |
Color m_EvenCellColor; | |
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 UnityEditor.SceneManagement; | |
// Adds a "Edit Prefab" option in the Assets menu (or right clicking an asset in the project browser). | |
// This opens an empty scene with your prefab where you can edit it. | |
// Put this script in your project as Assets/Editor/EditPrefab.cs | |
public class EditPrefab { | |
static Object getPrefab(Object selection) { |
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 UnityEditor.SceneManagement; | |
using UnityEngine.SceneManagement; | |
// From https://gist.github.com/JohannesDeml/5802473b569718c9c86de906b7039aec | |
// Original https://gist.github.com/ulrikdamm/338392c3b0900de225ec6dd10864cab4 | |
// Adds a "Edit Prefab" option in the Assets menu (or right clicking an asset in the project browser). | |
// This opens an empty scene with your prefab where you can edit it. | |
// Put this script in your project as Assets/Editor/EditPrefab.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; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Reflection; | |
public static class ReflectiveEnumerator | |
{ | |
/// <summary> | |
/// Original class from StackExchange post | |
/// https://stackoverflow.com/questions/5411694/get-all-inherited-classes-of-an-abstract-class/6944605#6944605 |
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
public class RollingList<T> : List<T> | |
{ | |
private int indexer = 0; | |
private int maxIndexer; | |
public RollingList() : base() | |
{ | |
maxIndexer = this.Count; | |
} |
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 System.Collections.Generic; | |
using System.ComponentModel; | |
using System.Linq; | |
using System.Runtime.InteropServices; | |
using System.Runtime.Serialization; | |
using System.Security.Permissions; | |
using System.Windows.Forms; | |
namespace Xeph.Windows.Forms.ExtendedControls |
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 UnityEngine; | |
/// <summary> | |
/// The MainCameraEllipticalMWE class provides motion of the camera in an ellipse (or a circle) | |
/// given sizeX and sizeZ where one is the major axis and the other the minor axis. Which is | |
/// which isn't important, and they can be equal (x == z) if the camera is to track in a circle. | |
/// | |
/// The size values assume a 2D surface where x=0, z=0 is at the bottom left and built in both x+ | |
/// and z+ directions. |
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 System.Collections.Generic; | |
using System.Linq; | |
using System.Reflection; | |
// Requires C# 7.3 or later (Roslyn 3.0 or later) for where TEnum : System.Enum | |
public class Program | |
{ | |
public static void Main() | |
{ |
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
[System.Flags] | |
public enum LaserDirection | |
{ | |
NONE = 0, | |
NORTH = 1 << 0, | |
NORTHEAST = 1 << 1, | |
EAST = 1 << 2, | |
SOUTHEAST = 1 << 3, | |
SOUTH = 1 << 4, |
NewerOlder