コード例 #1
0
ファイル: VacuumSoundEditor.cs プロジェクト: asmboom/VACC
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        VacuumSound script = (VacuumSound)target;

        if (GUILayout.Button("Start Engine"))
        {
            if (Application.isPlaying)
            {
                script.StartEngine();
            }
        }

        if (GUILayout.Button("Stop Engine"))
        {
            if (Application.isPlaying)
            {
                script.StopEngine();
            }
        }

        if (GUI.changed)
        {
            EditorUtility.SetDirty(vacuumSound);
        }

        serializedVacuumSound.ApplyModifiedProperties();
    }
コード例 #2
0
 private void UpdateDustSuckerStatus(bool status)
 {
     dustSuckerActive = status;
     if (dustSuckerActive)
     {
         sound.StartEngine();
     }
     else
     {
         sound.StopEngine();
     }
 }
コード例 #3
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        VacuumSound script = (VacuumSound)target;

        if (GUILayout.Button("Start Engine"))
        {
            script.StartEngine();
        }

        if (GUILayout.Button("Stop Engine"))
        {
            script.StopEngine();
        }
    }