Example #1
0
        internal void Show(Message mess, MainCamera mainCamera, int howMuchShift)
        {
            this.mainCamera = mainCamera;
            howMuchPausedWindowsOpen++;
            caption.text   = mess.GetCaption();
            message.text   = mess.GetText();
            closeText.text = mess.GetClosetext();
            messageSource  = mess;

            dragPanel         = GetComponent <DragPanel>();
            dragPanel.Hidden += OnHidden;
            GUIChanger.Apply(gameObject);
            showDefeatingAttackerMessage.isOn = MessageSystem.Instance.ShowDefeatingAttackersMessages;

            if (firstLaunch)
            {
                var rect = GetComponent <RectTransform>();
                rect.transform.position    = new Vector3((Screen.width - rect.sizeDelta.x) / 2, (Screen.height - rect.sizeDelta.y) / 2, rect.position.z);
                previousWindowLastPosition = transform.localPosition;
            }
            else
            {
                transform.localPosition = previousWindowLastPosition - offset * howMuchShift;
            }

            firstLaunch = false;
            dragPanel.Show();
        }
Example #2
0
        // Use this for initialization
        private void Start()
        {
            Vector3 position = Vector3.zero;

            position.Set(lastDragPosition.x - 10f, lastDragPosition.y - 10f, 0);
            transform.localPosition = position;
            lastDragPosition        = transform.localPosition;
            GUIChanger.Apply(gameObject);
            showDefeatingAttackerMessage.isOn = Message.ShowDefeatingAttackersMessages;
            var rect = GetComponent <RectTransform>();

            rect.transform.position = new Vector3((Screen.width - rect.sizeDelta.x) / 2, (Screen.height - rect.sizeDelta.y) / 2, rect.position.z);
        }
Example #3
0
        // Use this for initialization
        void Start()
        {
            Vector3 position = Vector3.zero;

            position.Set(lastDragPosition.x - 10f, lastDragPosition.y - 10f, 0);
            transform.localPosition = position;
            lastDragPosition        = transform.localPosition;

            //var image = GetComponent<Image>();
            //image.color = GUIChanger.BackgroundColor;
            //image.material = null;
            //image = GetComponentInChildren<Image>();
            //image.color = GUIChanger.ButtonsColor;
            GUIChanger.Apply(this.gameObject);
            showDefeatingAttackerMessage.isOn = Message.ShowDefeatingAttackersMessages;
        }