Example #1
0
    public override void OnChildInspectorGUI()
    {
        instance = (AudioEmitterEditor)target;
        //  InspectorBuildHelper.BuildEnum(TriggerType, EAudioTriggerType.None);
        BuildSourceDataBox();
        BuildEmitterBox();
        BuildEventTemplate();
        InspectorBuildHelper.BuildSimple(LogEnabled, "LogEnabled");
        InspectorBuildHelper.BuildSimple(LookAtListener, "LookAtListener");

        //  BuildEmitterBox();
    }
Example #2
0
    void BuildEmitterBox()
    {
        tmpConstructActions1.Clear();
        tmpConstructActions1.Add(() => InspectorBuildHelper.BuildEnum(EmitType, EAudioEmitType.PlayOnce));
        //var list = new List<Action>();
        tmpConstructActions1.Add(() => InspectorBuildHelper.BuildSimple(EmitTimeInterval, "Emit Interval"));
        UnityEngine.GUILayout.Space(UnityEditor.EditorGUIUtility.standardVerticalSpacing);
        using (new UnityEditor.EditorGUILayout.VerticalScope("box"))
        {
            InspectorBuildHelper.BuildEnum(EmitType, EAudioEmitType.PlayOnce);
            if ((EAudioEmitType)EmitType.enumValueIndex == EAudioEmitType.PlayOnce)
            {
                if (InspectorBuildHelper.BuildButton("Play"))
                {
                    instance.PlayOnce();
                }
            }
            else
            {
                InspectorBuildHelper.BuildSimple(EmitTimeInterval, "Emit interval");
                if (instance.StopContinueAudio)
                {
                    if (InspectorBuildHelper.BuildButton("Resume"))
                    {
                        instance.Resume();
                    }
                }
                else
                {
                    if (InspectorBuildHelper.BuildButton("Stop"))
                    {
                        instance.Stop();
                    }
                }
            }
            if (InspectorBuildHelper.BuildButton("Stop All"))
            {
                instance.StopAll();
            }
            if (InspectorBuildHelper.BuildButton("Reload Config XML"))
            {
                instance.ReloadXML();
            }
            if (InspectorBuildHelper.BuildButton("Init Wise Bank"))
            {
                instance.ReloadWiseBank();
            }
        }

        UnityEngine.GUILayout.Space(UnityEditor.EditorGUIUtility.standardVerticalSpacing);
    }
Example #3
0
 void BuildEventTemplate()
 {
     using (new UnityEditor.EditorGUILayout.VerticalScope("box"))
     {
         InspectorBuildHelper.BuildTip("Event Commom Action");
         InspectorBuildHelper.BuildSimple(actionOnEventType, "Event Executable");
         InspectorBuildHelper.BuildSimple(curveInterpolation, "Interpolation Curve");
         InspectorBuildHelper.BuildSlider(transitionDuration, new Vector2(0, 60f), "transitionDuration (s)");
         if (InspectorBuildHelper.BuildButton("Excute"))
         {
             instance.PlayEventTemplate();
         }
     }
 }