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
// < !--Add to YOUR_PROJECT.csproj-- > | |
// < Project Sdk = "Microsoft.NET.Sdk" > | |
// | |
// < !--... --> | |
// | |
// < ItemGroup > | |
// < Analyzer Include = "ABSOLUTE_OR_RELATIVE_FOLDER\DontCallBaseImplementation.dll" /> | |
// </ ItemGroup > | |
// | |
// < !--... --> |
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; | |
using UnityEngine.Assertions; | |
using UnityEngine.EventSystems; | |
using UnityEngine.UI; | |
using UInput = UnityEngine.Input; | |
public interface IGraphicInputProvider | |
{ | |
public Vector2 Drag { get; } |
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.Reflection; | |
using UnityEditor; | |
using UnityEngine; | |
// [CustomEditor(typeof(YOUR_COMPONENT))] | |
public class AlertOnRemoveComponentEditor : | |
#if ODIN_INSPECTOR | |
Sirenix.OdinInspector.Editor.OdinEditor | |
#else |
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; | |
using System.Collections.Generic; | |
using System.Reflection; | |
using UnityEngine.UIElements; | |
public static VisualElement FindPanelRootVisualElementByPanelName(string panelName) | |
{ | |
// UnityEngine.UIElements.UIElementsUtility.GetAllPanels | |
// UnityEngine.UIElements.UIElementsUtility.GetPanelsIterator |
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 UnityEditor; | |
using UnityEngine; | |
public static class AssetTool | |
{ | |
// Add 'Move to' menu item to move selected assets to a folder | |
[MenuItem("Tools/Bamboo/Asset/Move Selected Assets to Folder")] | |
[MenuItem("Assets/Move to", priority = 20)] |
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
// Odin extension for foldout elements in list. | |
// Example: | |
// [Serializable] | |
// public class MyData1 : IFoldoutableInList | |
// { | |
// // members... | |
// } | |
// [Serializable] | |
// public class MyData2 : IForceFoldoutableInList | |
// { |
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
/// <summary> | |
/// Get gui style by name. | |
/// </summary> | |
/// <param name="styleName"></param> | |
/// <returns></returns> | |
public static GUIStyle GetStyleByName(string styleName) | |
{ | |
GUIStyle style = GUI.skin.FindStyle(styleName); | |
if (style == null) | |
{ |
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
// NOTE: The 'SimpleHarmonicMotion.cs' is here: https://gist.github.com/SolarianZ/78f9b22d9663d77b6e6c1b0c60cc6322 | |
// You need to change `System.Numerics.Vector3` to `UnityEngine.Vector3` in SimpleHarmonicMotion.cs | |
using UnityEngine; | |
#if UNITY_EDITOR | |
using UnityEditor; | |
#endif | |
[DisallowMultipleComponent] | |
public class BoneVibrator : MonoBehaviour |
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
// NOTE: The 'SimpleHarmonicMotion.cs' is here: https://gist.github.com/SolarianZ/78f9b22d9663d77b6e6c1b0c60cc6322 | |
using UnityEngine; | |
using SVector3 = System.Numerics.Vector3; | |
using UVector3 = UnityEngine.Vector3; | |
#if UNITY_EDITOR | |
using UnityEditor; | |
#endif | |
[DisallowMultipleComponent] |
NewerOlder