Beispiel #1
0
        public void SetDataImageAnnouncement(Sprite toDisplay, Action closeImplementation, EPanelSize dSize = EPanelSize.MediumLandscape, UIType uiType = UIType.NormalView)
        {
            if (toDisplay == null)
            {
                return;
            }

            DescriptionPanel.Deactivate();
            ImageOnlyPanel.Activate();

            ImageOnlyAnnouncement.sprite = toDisplay;

            OnClickClose = closeImplementation;
            OnClickOk    = null;
            OnClickYes   = null;
            OnClickNo    = null;

            if (YesButton != null)
            {
                YesButton.Deactivate();
            }
            if (NoButton != null)
            {
                NoButton.Deactivate();
            }
            if (OKButton != null)
            {
                OKButton.Deactivate();
            }
            if (CloseButton != null)
            {
                CloseButton.Activate();
            }

            AdjustDialogSize(dSize);

            switch (uiType)
            {
            case UIType.StackedView:
            {
                ViewController.ActivateWithStackView(this);
            }
            break;

            case UIType.NormalView:
            {
                ViewController.ActivateWithNormalView(this);
            }
            break;

            case UIType.BaseView:
            {
                Debug.LogWarning("base type is not supported");
            }
            break;
            }
        }
Beispiel #2
0
        public void SetDataYesNo(string displayText, Action yesImplementation, Action noImplementation, EPanelSize dSize = EPanelSize.MediumPortrait, bool reset = false,
                                 bool shouldUseAcceptAndDecline = false, UIType uiType = UIType.NormalView)
        {
            if (reset)
            {
                ResetFormat();
            }

            DescriptionPanel.Activate();
            ImageOnlyPanel.Deactivate();

            Description.SetText(displayText);
            OnClickYes   = yesImplementation;
            OnClickNo    = noImplementation;
            OnClickOk    = null;
            OnClickClose = null;

            if (YesButton != null)
            {
                if (shouldUseAcceptAndDecline)
                {
                    YesButton.GetComponentInChildren <Text>().SetText("Accept");
                }

                YesButton.Activate();
            }

            if (NoButton != null)
            {
                if (shouldUseAcceptAndDecline)
                {
                    NoButton.GetComponentInChildren <Text>().SetText("Decline");
                }

                NoButton.Activate();
            }

            if (OKButton != null)
            {
                OKButton.Deactivate();
            }

            if (CloseButton != null)
            {
                CloseButton.Deactivate();
            }

            Description.Activate();
            ImageAnnouncement.Deactivate();

            AdjustDialogSize(dSize);

            switch (uiType)
            {
            case UIType.StackedView:
            {
                ViewController.ActivateWithStackView(this);
            }
            break;

            case UIType.NormalView:
            {
                ViewController.ActivateWithNormalView(this);
            }
            break;

            case UIType.BaseView:
            {
                Debug.LogWarning("base type is not supported");
            }
            break;
            }
        }