Skip to content

Instantly share code, notes, and snippets.

@MaZyGer
MaZyGer / EditorModeOnly
Last active April 22, 2024 08:49
The default EditorOnly of Unity Engine will only remove objects from standalone player and not in the editor. EditorModeOnly will remove also objects if you start playmode in the editor. Its really nice for things such as UI List tests, to remove the list in play mode. You can remove or change the namespace if you want. Drop it in an Editor fold…
using System.Collections.Generic;
using UnityEditor;
using UnityEditor.Callbacks;
using UnityEngine;
namespace Maz.Unity.EditorExtensions
{
[InitializeOnLoad]
public class EditorModeOnly
{
@MaZyGer
MaZyGer / PhysicsExtension.cs
Last active September 17, 2020 13:41
This class may will be get updated after time with more functionality. OverlapCircle<T> extension will allow to use conditions and filter out directly. Example you look for collider2d but with a component like Monster and also want to check directly is monster not dead? So use this function. Check the usage how to use it. **Please Read**: The sc…
using System.Collections.Generic;
using UnityEngine;
namespace Maz.Unity.Extensions
{
public static class MazPhysics2D
{
#region OverlapCircle
/* Usage for OverlapCircle<T>:
Example you threw a grenade and you want to find at the position monsters with Monster Component / MonoBehavoiur and also want to filter out dead monsters.