Skip to main content

🏷️ Attribute List

Main attributes for building debug menus.

Namespace
using Logify;

🔘 [LogiButton]

Basic attribute for executing methods. UI automatically switches based on presence of arguments.

1. Button Only (No Arguments)

ArgumentDescription
1st argumentLabel name
2nd argumentText within button
[LogiButton("Test Button", "Execute")]
void Test() { /* process */ }

2. With Input (With Arguments)

When applied to methods with arguments, UI is generated to input values and execute. Supports string, int, float, bool, Enum.

ArgumentDescription
1st argumentLabel name
2nd argumentText within button
3rd argumentField initial value
[LogiButton("Test Integer", 10)]
void Test(int integer) { }

📥 [LogiInput]

Attribute for directly inputting and modifying values. Supports string, int, float, bool, Enum.

ArgumentDescription
1st argumentLabel name
2nd argumentField initial value
[LogiInput("Test Integer", 100)]
void Test(int integer) { }

🎚️ [LogiRange] / [LogiRangeButton]

Adjust numeric values with range specification (slider). Supports int, float.

ArgumentDescription
1st argumentLabel name
2nd argumentMinimum value
3rd argumentMaximum value
4th argumentField initial value
[LogiRange("Test Range integer", 0, 100, 10)]
void TestRangeButton(int integer) { }

🖼️ [LogiPreview]

Allows viewing images. Supports Sprite, Texture2D.

[LogiPreview("Test Sprite")]
Sprite GetPlayerIcon() => _playerIcon;

📝 Information Display

Attributes specialized for "displaying" debug information.

[LogiLabel]

Simple text display.

[LogiLabel]
string GetStatus() => "Test Label";

[LogiStatus]

Status display with label. Can select copy button display option.

[LogiStatus("Test Status", true)]
string GetBuildSign() => $"Integer set to: {_integer}";

[LogiTextArea]

Suitable for viewing or inputting long text.

[LogiTextArea("Test Text Area")]
void UpdateLog(string text) { }

⚠️ Managed Stripping Considerations

When Unity's build setting Managed Stripping Level is set to Medium or High, methods and fields not directly referenced in code may be removed (stripped) by Unity during builds.

Since Logify-Unity uses reflection to detect Attributes, they won't appear in the debug menu if stripped. If this occurs, add the [Preserve] attribute alongside attributes on members.

using UnityEngine.Scripting; // Required for Preserve attribute
using Logify;

public class PlayerDebug : MonoBehaviour
{
[LogiButton("Level Up")]
[Preserve] // Stripping countermeasure
void LevelUp()
{
// ...
}
}
Batch Countermeasure

If applying [Preserve] individually is cumbersome, we recommend creating a link.xml file to collectively exclude specific classes or namespaces from stripping.

Show link.xml configuration example
<linker>
<assembly fullname="Logify" preserve="all"/>

<assembly fullname="YourGame.Scripts">

<namespace fullname="YourGame.Debug" preserve="all"/>

<type fullname="YourGame.Managers.PlayerManager" preserve="nothing">
<method signature="System.Void LevelUp()"/>
<method signature="System.Void AddItem(System.Int32,System.String)"/>
</type>
</assembly>

<assembly fullname="UnityEngine.CoreModule" preserve="all"/>
</linker>