add new pack: Editor Attributes, complete GoTo cmd

This commit is contained in:
MinhHai
2026-01-09 15:01:29 +07:00
parent b9bf09f31a
commit 219c87f469
462 changed files with 18860 additions and 2 deletions
@@ -0,0 +1,28 @@
using UnityEngine;
using EditorAttributes;
namespace EditorAttributesSamples
{
[HelpURL("https://editorattributesdocs.readthedocs.io/en/latest/Attributes/ButtonAttributes/buttonfield.html")]
public class ButtonFieldSample : MonoBehaviour
{
[Header("ButtonField Attribute:")]
[ButtonField(nameof(PrintNumber), buttonHeight: 30f)]
[SerializeField] private Void buttonHolder;
[SerializeField] private int number;
[HorizontalGroup(true, nameof(buttonHolder01), nameof(buttonHolder02))]
[SerializeField] private Void groupHolder;
[ButtonField(nameof(PrintMessage))]
[SerializeField, HideInInspector] private Void buttonHolder01;
[ButtonField(nameof(PrintMessage), true, 60, 300, "Hold Me")]
[SerializeField, HideInInspector] private Void buttonHolder02;
private void PrintNumber() => print(number);
private void PrintMessage() => print("Hello World!");
}
}
@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 5e12730e70d968341ab27b24e3a4c647
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 269285
packageName: EditorAttributes
packageVersion: 2.9.2
assetPath: Assets/EditorAttributes/Samples/Scripts/ButtonAttributeSamples/ButtonFieldSample.cs
uploadId: 806636
@@ -0,0 +1,27 @@
using UnityEngine;
using EditorAttributes;
namespace EditorAttributesSamples
{
[HelpURL("https://editorattributesdocs.readthedocs.io/en/latest/Attributes/ButtonAttributes/button.html")]
public class ButtonSample : MonoBehaviour
{
[Header("Button Attribute:")]
[SerializeField] private bool toggleButtons;
[Button("Button")]
public void PrintMessage() => print("Hello World!");
[Button]
public void ButtonWithParams(string messageToPrint) => print(messageToPrint);
[Button(true, 60, 300, "Hold Me", 30f)]
public void TallRepetableButton() => print(Random.value);
[Button(nameof(toggleButtons), ConditionResult.EnableDisable, true)]
public void ButtonYouCanDisable() => print("Hello World!");
[Button(nameof(toggleButtons), ConditionResult.ShowHide, true)]
public void ButtonYouCanHide() => print("Hello World!");
}
}
@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 1d54a8ed3d68d874f8e8a61ac46f3bb0
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 269285
packageName: EditorAttributes
packageVersion: 2.9.2
assetPath: Assets/EditorAttributes/Samples/Scripts/ButtonAttributeSamples/ButtonSample.cs
uploadId: 806636
@@ -0,0 +1,26 @@
using UnityEngine;
using EditorAttributes;
namespace EditorAttributesSamples
{
[HelpURL("https://editorattributesdocs.readthedocs.io/en/latest/Attributes/ButtonAttributes/inlinebutton.html")]
public class InlineButtonSample : MonoBehaviour
{
[Header("InlineButton Attribute:")]
[InlineButton(nameof(PrintString))]
[SerializeField] private string stringField;
[InlineButton(nameof(AddValue), true, buttonLabel: "Hold to add +10", buttonWidth: 200f)]
[SerializeField] private int intField;
[InlineButton(nameof(DecreaseFloat), "-", 20f), InlineButton(nameof(IncreaseFloat), "+", 20f)]
[SerializeField] private float floatField;
private void PrintString() => print(stringField);
private void AddValue() => intField += 10;
private void IncreaseFloat() => floatField += 0.5f;
private void DecreaseFloat() => floatField -= 0.5f;
}
}
@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 54eba7fde35b8ae4e8fa8b3cffae756c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 269285
packageName: EditorAttributes
packageVersion: 2.9.2
assetPath: Assets/EditorAttributes/Samples/Scripts/ButtonAttributeSamples/InlineButtonSample.cs
uploadId: 806636
@@ -0,0 +1,41 @@
using System;
using UnityEngine;
using EditorAttributes;
namespace EditorAttributesSamples
{
[HelpURL("https://editorattributesdocs.readthedocs.io/en/latest/Attributes/ButtonAttributes/selectionbuttons.html")]
public class SelectionButtonsSample : MonoBehaviour
{
public enum States
{
State01,
State02,
State03
}
[Flags]
public enum Flags
{
Flag01 = 0,
Flag02 = 1,
Flag03 = 2,
Flag04 = 4,
Flag05 = 8
}
[Header("SelectionButtons Attribute:")]
#if UNITY_6000_0_OR_NEWER
[SerializeField, HelpBox("This attribute has been deprecated use the <b>EnumButtons Attribute</b> instead", MessageMode.Warning)] private EditorAttributes.Void helpBoxHolder;
#else
[SerializeField, SelectionButtons] private States states;
[SerializeField, SelectionButtons(showLabel: false)] private Flags flags;
[SerializeField, SelectionButtons(nameof(stringValues), buttonsHeight: 30f)] private string stringField;
#endif
private string[] stringValues = new string[]
{
"Value01", "Value02", "Value03", "Value04", "Value05", "Value06"
};
}
}
@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 1d1ce0ec69ae593429f8798d7b1b0c3d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 269285
packageName: EditorAttributes
packageVersion: 2.9.2
assetPath: Assets/EditorAttributes/Samples/Scripts/ButtonAttributeSamples/SelectionButtonsSample.cs
uploadId: 806636
@@ -0,0 +1,17 @@
using UnityEngine;
using EditorAttributes;
namespace EditorAttributesSamples
{
[HelpURL("https://editorattributesdocs.readthedocs.io/en/latest/Attributes/ButtonAttributes/valuebuttons.html")]
public class ValueButtonsSample : MonoBehaviour
{
[Header("ValueButtons Attribute:")]
[SerializeField, ValueButtons(nameof(stringValues))] private string stringField;
private string[] stringValues = new string[]
{
"Value01", "Value02", "Value03", "Value04", "Value05", "Value06"
};
}
}
@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 4c49b76613cda164091de1311890eeba
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 269285
packageName: EditorAttributes
packageVersion: 2.9.2
assetPath: Assets/EditorAttributes/Samples/Scripts/ButtonAttributeSamples/ValueButtonsSample.cs
uploadId: 806636