/* * void CreateGameObject() * { * m_TargetGameObject = new GameObject(); * AddRequiredComponents(m_TargetGameObject); * SelectGameObject(m_TargetGameObject); * } */ void SetToolbarEnable(bool enable) { bool playing = EditorApplication.isPlaying; m_EditAssetButton.SetEnabled(enable); m_BuildButton.SetEnabled(enable && !playing); m_CancelBuildButton.SetEnabled(enable && !playing); m_PreviewToggle.SetEnabled(enable); rootVisualElement.Q <PreviewSelector>().SetEnabled(enable); rootVisualElement.Q <PlayControls>().SetEnabled(enable); rootVisualElement.Q <Button>(classes: "viewMode").SetEnabled(enable); ShowOrHideAssetDirtyWarning(playing); }