Beispiel #1
0
 /// <summary>
 /// The default constructor for the COPPA UI drawer that subscribes to the callback events
 /// for the Cancel and Save buttons.
 /// </summary>
 public CoppaDrawer()
 {
     m_VisualElement = new VisualElement();
     var coppaManager = new CoppaManager(m_VisualElement)
     {
         cancelButtonCallback = _ =>
         {
             OnProjectStateChanged();
         },
         saveButtonCallback = _ =>
         {
             OnProjectStateChanged();
         },
         exceptionCallback = OnExceptionCallback
     };
 }
Beispiel #2
0
        void SetupCoppaManager(VisualElement parentContainer)
        {
            //remove old version if any
            parentContainer.Q(CoppaManager.coppaContainerName)?.parent?.RemoveFromHierarchy();
            m_CoppaManager = new CoppaManager(parentContainer)
            {
                exceptionCallback = (compliance, exception) =>
                {
                    NotificationManager.instance.Publish(Notification.Topic.CoppaCompliance, Notification.Severity.Error,
                                                         L10n.Tr(exception.Message));
                }
            };
            var coppaContainer    = rootVisualElement.Q(CoppaManager.coppaContainerName);
            var editModeContainer = coppaContainer?.Q(className: k_ClassNameEditMode);

            editModeContainer?.SetEnabled(false);
        }