Skip to content

Commit

Permalink
[feat] microphone dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
srcnalt committed Feb 3, 2025
1 parent b0b49d0 commit 2528115
Show file tree
Hide file tree
Showing 7 changed files with 915 additions and 7 deletions.
25 changes: 25 additions & 0 deletions Editor/UI/NeocortexMicrophoneDropdownEditor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using UnityEditor;
using UnityEngine;

namespace Neocortex
{
[CustomEditor(typeof(NeocortexMicrophoneDropdown))]
public class NeocortexMicrophoneDropdownEditor : UnityEditor.Editor
{
private const string COMPONENT_NAME_IN_HIERARCY = "Microphone Dropdown";

[MenuItem("GameObject/Neocortex/Microphone Dropdown", false, -int.MaxValue)]
private static void AddElement()
{
EditorUtilities.CreateInCanvas<NeocortexMicrophoneDropdown>(COMPONENT_NAME_IN_HIERARCY, (canvas, target) =>
{
var targetTransform = target.transform as RectTransform;
var canvasTransform = canvas.transform as RectTransform;

if (targetTransform == null || canvasTransform == null) return;

targetTransform.anchoredPosition = new Vector2(0, 0);
});
}
}
}
11 changes: 11 additions & 0 deletions Editor/UI/NeocortexMicrophoneDropdownEditor.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2528115

Please sign in to comment.