コード例 #1
0
    public override void OnInspectorGUI()
    {
        USpeaker tg = (USpeaker)target;

        tg.SpeakerMode = (SpeakerMode)EditorGUILayout.EnumPopup("Speaker Mode", tg.SpeakerMode);

        tg.BandwidthMode = (BandMode)EditorGUILayout.Popup("Bandwidth Mode", (int)tg.BandwidthMode, new string[] { "Narrow - 8 kHz", "Wide - 16 kHz" });
        if ((int)tg.BandwidthMode > 1)
        {
            tg.BandwidthMode = BandMode.Narrow;
        }

        tg.SendingMode = (SendBehavior)EditorGUILayout.Popup("Sending Mode", (int)tg.SendingMode, new string[] { "Send while recording", "Record then send" });

        tg.UseVAD = EditorGUILayout.Toggle("Volume Activated", tg.UseVAD);

        tg.DebugPlayback = EditorGUILayout.Toggle("Debug Playback", tg.DebugPlayback);

        string sendrate = tg.SendRate + "/sec";

        if (tg.SendRate < 1.0f)
        {
            sendrate = "1 per " + (1.0f / tg.SendRate) + " secs";
        }

        tg.SendRate = EditorGUILayout.FloatField("Send Rate (" + sendrate + ")", tg.SendRate);
        if (tg.SendRate <= 0)
        {
            tg.SendRate = Mathf.Epsilon;
        }

        tg.Is3D = EditorGUILayout.Toggle("3D", tg.Is3D);

        tg.AskPermission = EditorGUILayout.Toggle("Ask for Mic Permission", tg.AskPermission);

        tg.PlayBufferSize = EditorGUILayout.FloatField("Play Buffer Length (s)", tg.PlayBufferSize);

        tg.GetInputHandler();

        tg.DrawTalkControllerUI();
    }