コード例 #1
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();
        EditorGUILayout.BeginVertical();

        if (m_fmodEVent == null)
        {
            Debug.LogWarning("aaaaaaaaaaaaaa-----------------");

            return;
        }

        ///Check if event path is changed
        if (m_oldEventPath != m_fmodEVent.EventPath)
        {
            InitVariable();
        }

        EditorGUILayout.Space();
        ///Create a slider for all parameter
        ShowParameterSlider();

        EditorGUILayout.Space();
        #region Test-Button
        EditorGUILayout.BeginHorizontal();
        if (GUILayout.Button("Build Event"))
        {
            m_fmodEVent.InitFmodEvent();
            InitVariable();
            m_fmodEVent.StopAudio();
        }

        if (GUILayout.Button("PlayAudio"))
        {
            m_fmodEVent.PlayAudio();
            EditorUtility.SetDirty(m_fmodEVent);
        }

        if (GUILayout.Button("StopAudio"))
        {
            m_fmodEVent.StopAudio();
        }
        EditorGUILayout.EndHorizontal();

        #endregion
        EditorGUILayout.EndVertical();
    }