Esempio n. 1
0
 //
 public void showPopup(PopupMode mode, string header, string message, Action <int> callback = null)
 {
     if (MainMenu.Instance.popup != null)
     {
         MainMenu.Instance.popup.showPopup(mode, header, message, callback);
     }
 }
Esempio n. 2
0
            public static void Show(PopupMode mode, Rect buttonRect, int controlID, int value, Func <int, string> bitToName)
            {
                MaskWindow.controlID = controlID;
                MaskWindow.value     = value;

                _count = 0;

                for (int i = 0; i < 32; i++)
                {
                    var name = bitToName(i);
                    if (!string.IsNullOrEmpty(name))
                    {
                        _names[_count] = name;
                        _bits[_count]  = i;
                        _count++;
                    }
                }

                _mode          = mode;
                _hoverLine     = 0;
                _buttonWidth   = buttonRect.width;
                _focusedWindow = EditorWindow.focusedWindow;

                _instance = new MaskWindow();
                Undo.undoRedoPerformed += Close;
                PopupWindow.Show(buttonRect, _instance);
            }
Esempio n. 3
0
        //
        // Public methods
        //
        public void showPopup(PopupMode mode, string header, string message, Action <int> callback = null)
        {
            //EditorGizmoSystem.Instance.TurnOffGizmos ();

            txtHeader.text         = "";
            txtMessage.text        = "";
            txtOverlayMessage.text = "";

            if (header != null)
            {
                txtHeader.text = header;
            }

            if (message != null)
            {
                if (mode == PopupMode.Overlay)
                {
                    setOverlayText(message);
                }
                else
                {
                    txtMessage.text = message;
                }
            }

            txtInputCaption.text = "";
            inputField.gameObject.SetActive(false);

            showButton(btnOkay, false);
            showButton(btnYes, false);
            showButton(btnNo, false);

            if (mode == PopupMode.Confirmation)
            {
                showButton(btnYes, true);
                showButton(btnNo, true);
            }
            else if (mode == PopupMode.Input)
            {
                showButton(btnYes, true);
                showButton(btnNo, true);
            }
            else if (mode == PopupMode.Notification)
            {
                showButton(btnOkay, true);
            }
            else if (mode == PopupMode.Overlay)
            {
                //
            }

            _callback = callback;
            if (blocker)
            {
                blocker.SetActive(true);
            }
            gameObject.SetActive(true);
        }
Esempio n. 4
0
        public ShapeEditorWindowPopup(PopupMode popupMode, ShapeEditor.Project project, Action <ShapeEditorWindowPopup> onApply) : base()
        {
            this.popupMode = popupMode;

            // read the extrude settings from the project.
            extrudeDepth                 = project.extrudeDepth;
            extrudeClipDepth             = project.extrudeClipDepth;
            extrudeScale                 = project.extrudeScale;
            revolve360                   = project.revolve360;
            revolveSteps                 = project.revolveSteps;
            revolveSpiralSloped          = project.revolveSpiralSloped;
            convexBrushes                = project.convexBrushes;
            GlobalPivotPosition_Position = project.globalPivot.position;

            this.onApply = (self) =>
            {
                // store the extrude settings in the project.
                switch (popupMode)
                {
                case PopupMode.CreatePolygon:
                    project.extrudeScale  = extrudeScale;
                    project.convexBrushes = convexBrushes;
                    break;

                case PopupMode.RevolveShape:
                    project.extrudeScale        = extrudeScale;
                    project.convexBrushes       = convexBrushes;
                    project.revolve360          = revolve360;
                    project.revolveSteps        = revolveSteps;
                    project.revolveSpiralSloped = revolveSpiralSloped;
                    break;

                case PopupMode.ExtrudeShape:
                    project.extrudeScale  = extrudeScale;
                    project.convexBrushes = convexBrushes;
                    project.extrudeDepth  = extrudeDepth;
                    break;

                case PopupMode.ExtrudePoint:
                    project.extrudeScale  = extrudeScale;
                    project.convexBrushes = convexBrushes;
                    project.extrudeDepth  = extrudeDepth;
                    break;

                case PopupMode.ExtrudeBevel:
                    project.extrudeScale     = extrudeScale;
                    project.convexBrushes    = convexBrushes;
                    project.extrudeDepth     = extrudeDepth;
                    project.extrudeClipDepth = extrudeClipDepth;
                    break;
                }

                onApply(self);
                editorWindow.Close();
                EditorWindow.FocusWindowIfItsOpen <ShapeEditor.ShapeEditorWindow>();
            };
        }
    void StartPopUp()
    {
        if (null == FisticuffsController.Instance)
        {
            Debug.LogError("CharacterBehaviors::StartPopUp - FisticuffsController.Instance not set. Is there one in the scene?");
            return;
        }

        popUpMode = PopupMode.Started;

        if (okToPlaySounds == true)           // don't let the sound play as app is first setting up (first game loop on enable)
        {
            FisticuffsController.Instance.oneShotAudio.PlayOneShot(FisticuffsController.Instance.pop);
        }
        okToPlaySounds = true;
    }
Esempio n. 6
0
        //
        public void showPopup(PopupMode mode, string header, string caption, string placeholder, Action <int> callback = null)
        {
            showPopup(mode, header, "", callback);

            inputField.gameObject.SetActive(true);

            txtInputCaption.text = caption;
            if (LevelData.Instance.lastLevelName == Globals.defaultLevelName)
            {
                txtInputPlaceHolder.text = placeholder;
                inputField.text          = "";
            }
            else
            {
                txtInputPlaceHolder.text = "";
                inputField.text          = LevelData.Instance.lastLevelName;
            }
        }
    // Lerps to the various y positions needed for the procedural pop up animation:
    void PopUp()
    {
        if (iLost)
        {
            return;
        }

        Vector3 myPos = transform.localPosition;

        if (popUpMode == PopupMode.Started && myPos.y < 50)
        {
            popTargetHeight = 50;
        }
        else if (popUpMode == PopupMode.Started && (Mathf.Approximately(myPos.y, 50) || myPos.y > 50))
        {
            popUpMode = PopupMode.InProgress;
        }

        if (popUpMode == PopupMode.InProgress && myPos.y > 15)
        {
            popTargetHeight = 15;
        }
        else if (popUpMode == PopupMode.InProgress && (Mathf.Approximately(myPos.y, 15) || myPos.y < 15))
        {
            popUpMode = PopupMode.Ending;
        }


        if (popUpMode == PopupMode.Ending && myPos.y < 30)
        {
            popTargetHeight = 30;
        }
        else if (popUpMode == PopupMode.Ending && (Mathf.Approximately(myPos.y, 30) || myPos.y > 30))
        {
            StopPopUp();
        }

        if (popUpMode != PopupMode.None)
        {
            float   newY   = Mathf.Lerp(myPos.y, popTargetHeight, 1);
            Vector3 newPos = new Vector3(0, newY, 6);
            transform.localPosition = newPos;
        }
    }
 public ReviewerNotePopup(PopupMode mode)
 {
     _mode = mode;
 }
 void StopPopUp()
 {
     popUpMode   = PopupMode.None;
     okToAnimate = true;
 }
Esempio n. 10
0
 public ReviewerNotePopup(PopupMode mode)
 {
     _mode = mode;
 }
Esempio n. 11
0
	void StopPopUp() {
		popUpMode = PopupMode.None;
		okToAnimate = true;
	}
Esempio n. 12
0
	void StartPopUp() {
		if (null == FisticuffsController.Instance) {
			Debug.LogError("CharacterBehaviors::StartPopUp - FisticuffsController.Instance not set. Is there one in the scene?");
			return;
		}

		popUpMode = PopupMode.Started;
	
		if (okToPlaySounds == true) { // don't let the sound play as app is first setting up (first game loop on enable)
			FisticuffsController.Instance.oneShotAudio.PlayOneShot(FisticuffsController.Instance.pop);
		}
		okToPlaySounds = true;
	}
Esempio n. 13
0
	// Lerps to the various y positions needed for the procedural pop up animation:
	void PopUp() { 
		if(iLost) {
			return;
		}

		Vector3 myPos = transform.localPosition;

		if (popUpMode == PopupMode.Started && myPos.y < 50) {
			popTargetHeight = 50;
		} else if (popUpMode == PopupMode.Started && (Mathf.Approximately(myPos.y, 50) || myPos.y > 50)) {
			popUpMode = PopupMode.InProgress;
		}
			
		if (popUpMode == PopupMode.InProgress && myPos.y > 15) {
			popTargetHeight = 15;
		} else if (popUpMode == PopupMode.InProgress && (Mathf.Approximately(myPos.y, 15) || myPos.y < 15)) {
			popUpMode = PopupMode.Ending;
		}
			
			
		if (popUpMode == PopupMode.Ending && myPos.y < 30) {
			popTargetHeight = 30;
		} else if (popUpMode == PopupMode.Ending && (Mathf.Approximately(myPos.y, 30) || myPos.y > 30)) {
			StopPopUp();
		}
		
		if (popUpMode != PopupMode.None) {
			float newY = Mathf.Lerp(myPos.y, popTargetHeight, 1);
			Vector3 newPos = new Vector3(0, newY, 6);
			transform.localPosition = newPos;
		}
		
	}