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.Reflection; | |
using UnityEditor; | |
using UnityEngine; | |
/// <summary> | |
/// Toggles the Inspector lock state and the Constrain Proportions lock state. | |
/// </summary> | |
public static class LockInspector { | |
static readonly MethodInfo flipLocked; | |
static readonly PropertyInfo constrainProportions; |
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 UnityEngine; | |
using TMPro; | |
/// <summary> | |
/// A generic 2D grid implementation that can be used in both 2D and 3D. | |
/// The grid stores values of a specified type and provides methods for accessing and modifying | |
/// these values based on grid coordinates or world coordinates. The grid can be displayed | |
/// either vertically (X-Y plane) or horizontally (X-Z plane) using a CoordinateConverter. | |
/// </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
namespace Match3 { | |
public class GridObject<T> { | |
GridSystem2D<GridObject<T>> grid; | |
int x; | |
int y; | |
T gem; | |
public GridObject(GridSystem2D<GridObject<T>> grid, int x, int y) { | |
this.grid = grid; | |
this.x = x; |
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.Reflection; | |
using UnityEngine; | |
using UnityEngine.Events; | |
#if UNITY_EDITOR | |
using UnityEditor.Events; | |
#endif | |
[Serializable] |
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 class LoadSceneAttribute : NUnitAttribute, IOuterUnityTestAction { | |
readonly string scene; | |
public LoadSceneAttribute(string scene) => this.scene = scene; | |
public IEnumerator BeforeTest(ITest test) { | |
Debug.Assert(scene.EndsWith(".unity"), "Scene must end with .unity"); | |
yield return EditorSceneManager.LoadSceneInPlayMode(scene, new LoadSceneParameters(LoadSceneMode.Single)); | |
} |
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; | |
public class Preconditions { | |
Preconditions() { } | |
public static T CheckNotNull<T>(T reference) { | |
return CheckNotNull(reference, null); | |
} | |
public static T CheckNotNull<T>(T reference, string message) { |
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; | |
[Serializable] | |
public class Observable<T> { | |
private T value; | |
public event Action<T> ValueChanged; | |
public T Value { | |
get => value; |
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.Collections; | |
/// <summary> | |
/// Initializes a new instance of the ObservableList class that is empty | |
/// or contains elements copied from the specified list. | |
/// </summary> | |
/// <param name="initialList"> The list to copy elements from. </param> | |
public interface IObservableList<T> { |
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
[CreateAssetMenu(fileName = "AbilityData", menuName = "ScriptableObjects/AbilityData", order = 1)] | |
public class AbilityData : ScriptableObject { | |
public AnimationClip animationClip; | |
public int animationHash; | |
public float duration; | |
public Sprite icon; | |
public string fullName; | |
void OnValidate() { |
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.Linq; | |
using UnityEditor; | |
using UnityEngine; | |
[Serializable] | |
public class SerializableType : ISerializationCallbackReceiver { | |
[SerializeField] string assemblyQualifiedName = string.Empty; | |
public Type Type { get; private set; } |
OlderNewer