Ejemplo n.º 1
0
        public override void ShowGUI(MenuSource source)
        {
            EditorGUILayout.BeginVertical("Button");
            if (source == MenuSource.AdventureCreator)
            {
                label     = EditorGUILayout.TextField("Default text:", label);
                inputType = (AC_InputType)EditorGUILayout.EnumPopup("Input type:", inputType);
                if (inputType == AC_InputType.AlphaNumeric)
                {
                    allowSpaces = EditorGUILayout.Toggle("Allow spaces?", allowSpaces);
                }
                characterLimit = EditorGUILayout.IntField("Character limit:", characterLimit);
                anchor         = (TextAnchor)EditorGUILayout.EnumPopup("Text alignment:", anchor);
                textEffects    = (TextEffects)EditorGUILayout.EnumPopup("Text effect:", textEffects);
                if (textEffects != TextEffects.None)
                {
                    outlineSize = EditorGUILayout.Slider("Effect size:", outlineSize, 1f, 5f);
                }
                linkedButton = EditorGUILayout.TextField("'Enter' key's linked Button:", linkedButton);
            }
            else
            {
                uiInput = LinkedUiGUI <InputField> (uiInput, "Linked InputField:", source);
            }
            EditorGUILayout.EndVertical();

            base.ShowGUI(source);
        }
        public override void ShowGUI(Menu menu)
        {
            string apiPrefix = "(AC.PlayerMenus.GetElementWithName (\"" + menu.title + "\", \"" + title + "\") as AC.MenuInput)";

            MenuSource source = menu.menuSource;

            EditorGUILayout.BeginVertical("Button");
            if (source == MenuSource.AdventureCreator)
            {
                inputType = (AC_InputType)CustomGUILayout.EnumPopup("Input type:", inputType, apiPrefix + ".inputType", "What kind of characters can be entered in by the player");
                label     = EditorGUILayout.TextField("Default text:", label);
                if (inputType == AC_InputType.AlphaNumeric)
                {
                    allowSpaces = CustomGUILayout.Toggle("Allow spaces?", allowSpaces, apiPrefix + ".allowSpace", "If True, then spaces are recognised");
                }
                characterLimit = CustomGUILayout.IntField("Character limit:", characterLimit, apiPrefix + ".characterLimit", "The character limit on text that can be entered");

                                #if (UNITY_IPHONE || UNITY_ANDROID) && !UNITY_2018_3_OR_NEWER
                EditorGUILayout.HelpBox("For the character limit to be obeyed on Android and iOS, Unity 2018.3 or later must be used.", MessageType.Info);
                                #endif

                linkedButton     = CustomGUILayout.TextField("'Enter' key's linked Button:", linkedButton, apiPrefix + ".linkedPrefab", "The name of the MenuButton element that is synced with the 'Return' key when this element is active");
                requireSelection = CustomGUILayout.ToggleLeft("Require selection to accept input?", requireSelection, apiPrefix + ".requireSelection", "If True, then the element will need to be selected before it receives input");
            }
            else
            {
                uiInput = LinkedUiGUI <InputField> (uiInput, "Linked InputField:", source);
                uiSelectableHideStyle = (UISelectableHideStyle)CustomGUILayout.EnumPopup("When invisible:", uiSelectableHideStyle, apiPrefix + ".uiSelectableHideStyle", "The method by which this element is hidden from view when made invisible");
            }
            EditorGUILayout.EndVertical();

            base.ShowGUI(menu);
        }
Ejemplo n.º 3
0
        public override void ShowGUI(Menu menu)
        {
            string apiPrefix = "AC.PlayerMenus.GetElementWithName (\"" + menu.title + "\", \"" + title + "\")";

            MenuSource source = menu.menuSource;

            EditorGUILayout.BeginVertical("Button");
            if (source == MenuSource.AdventureCreator)
            {
                inputType = (AC_InputType)CustomGUILayout.EnumPopup("Input type:", inputType, apiPrefix + ".inputType");
                label     = EditorGUILayout.TextField("Default text:", label);
                if (inputType == AC_InputType.AlphaNumeric)
                {
                    allowSpaces = CustomGUILayout.Toggle("Allow spaces?", allowSpaces, apiPrefix + ".allowSpace");
                }
                characterLimit = CustomGUILayout.IntField("Character limit:", characterLimit, apiPrefix + ".characterLimit");

                linkedButton = CustomGUILayout.TextField("'Enter' key's linked Button:", linkedButton, apiPrefix + ".linkedPrefab");
            }
            else
            {
                uiInput = LinkedUiGUI <InputField> (uiInput, "Linked InputField:", source);
                uiSelectableHideStyle = (UISelectableHideStyle)CustomGUILayout.EnumPopup("When invisible:", uiSelectableHideStyle, apiPrefix + ".uiSelectableHideStyle");
            }
            EditorGUILayout.EndVertical();

            base.ShowGUI(menu);
        }
Ejemplo n.º 4
0
        private void CopyInput(MenuInput _element, bool ignoreUnityUI)
        {
            if (ignoreUnityUI)
            {
                uiInput = null;
            }
            else
            {
                uiInput = _element.uiInput;
            }

            label                 = _element.label;
            anchor                = _element.anchor;
            textEffects           = _element.textEffects;
            outlineSize           = _element.outlineSize;
            inputType             = _element.inputType;
            characterLimit        = _element.characterLimit;
            linkedButton          = _element.linkedButton;
            allowSpaces           = _element.allowSpaces;
            uiSelectableHideStyle = _element.uiSelectableHideStyle;
            requireSelection      = _element.requireSelection;
            allowDecimals         = _element.allowDecimals;

            base.Copy(_element);
        }
Ejemplo n.º 5
0
		public void CopyInput (MenuInput _element)
		{
			label = _element.label;
			anchor = _element.anchor;
			textEffects = _element.textEffects;
			inputType = _element.inputType;
			characterLimit = _element.characterLimit;
			linkedButton = _element.linkedButton;
			allowSpaces = _element.allowSpaces;

			base.Copy (_element);
		}
Ejemplo n.º 6
0
        private void CopyInput(MenuInput _element)
        {
            uiInput        = _element.uiInput;
            label          = _element.label;
            anchor         = _element.anchor;
            textEffects    = _element.textEffects;
            inputType      = _element.inputType;
            characterLimit = _element.characterLimit;
            linkedButton   = _element.linkedButton;
            allowSpaces    = _element.allowSpaces;

            base.Copy(_element);
        }
Ejemplo n.º 7
0
        private void CopyInput(MenuInput _element)
        {
            uiInput               = _element.uiInput;
            label                 = _element.label;
            anchor                = _element.anchor;
            textEffects           = _element.textEffects;
            outlineSize           = _element.outlineSize;
            inputType             = _element.inputType;
            characterLimit        = _element.characterLimit;
            linkedButton          = _element.linkedButton;
            allowSpaces           = _element.allowSpaces;
            uiSelectableHideStyle = _element.uiSelectableHideStyle;

            base.Copy(_element);
        }
Ejemplo n.º 8
0
		public override void Declare ()
		{
			label = "Input";
			isVisible = true;
			isClickable = true;
			numSlots = 1;
			anchor = TextAnchor.MiddleCenter;
			SetSize (new Vector2 (10f, 5f));
			inputType = AC_InputType.AlphaNumeric;
			characterLimit = 10;
			linkedButton = "";
			textEffects = TextEffects.None;
			allowSpaces = false;

			base.Declare ();
		}
Ejemplo n.º 9
0
        /**
         * Initialises the element when it is created within MenuManager.
         */
        public override void Declare()
        {
            uiInput     = null;
            label       = "Input";
            isVisible   = true;
            isClickable = true;
            numSlots    = 1;
            anchor      = TextAnchor.MiddleCenter;
            SetSize(new Vector2(10f, 5f));
            inputType      = AC_InputType.AlphaNumeric;
            characterLimit = 10;
            linkedButton   = "";
            textEffects    = TextEffects.None;
            allowSpaces    = false;

            base.Declare();
        }
Ejemplo n.º 10
0
		public override void ShowGUI ()
		{
			EditorGUILayout.BeginVertical ("Button");
			label = EditorGUILayout.TextField ("Default text:", label);
			inputType = (AC_InputType) EditorGUILayout.EnumPopup ("Input type:", inputType);
			if (inputType == AC_InputType.AlphaNumeric)
			{
				allowSpaces = EditorGUILayout.Toggle ("Allow spaces?", allowSpaces);
			}
			characterLimit = EditorGUILayout.IntField ("Character limit:", characterLimit);
			anchor = (TextAnchor) EditorGUILayout.EnumPopup ("Text alignment:", anchor);
			textEffects = (TextEffects) EditorGUILayout.EnumPopup ("Text effect:", textEffects);
			linkedButton = EditorGUILayout.TextField ("'Enter' key's linked Button:", linkedButton);
			EditorGUILayout.EndVertical ();
			
			base.ShowGUI ();
		}
Ejemplo n.º 11
0
        /**
         * Initialises the element when it is created within MenuManager.
         */
        public override void Declare()
        {
            uiInput     = null;
            label       = "Input";
            isVisible   = true;
            isClickable = true;
            numSlots    = 1;
            anchor      = TextAnchor.MiddleCenter;
            SetSize(new Vector2(10f, 5f));
            inputType             = AC_InputType.AlphaNumeric;
            characterLimit        = 10;
            linkedButton          = string.Empty;
            textEffects           = TextEffects.None;
            outlineSize           = 2f;
            allowSpaces           = false;
            uiSelectableHideStyle = UISelectableHideStyle.DisableObject;
            requireSelection      = false;
            allowDecimals         = false;

            base.Declare();
        }
Ejemplo n.º 12
0
        public override void ShowGUI(MenuSource source)
        {
            EditorGUILayout.BeginVertical ("Button");
            if (source == MenuSource.AdventureCreator)
            {
                label = EditorGUILayout.TextField ("Default text:", label);
                inputType = (AC_InputType) EditorGUILayout.EnumPopup ("Input type:", inputType);
                if (inputType == AC_InputType.AlphaNumeric)
                {
                    allowSpaces = EditorGUILayout.Toggle ("Allow spaces?", allowSpaces);
                }
                characterLimit = EditorGUILayout.IntField ("Character limit:", characterLimit);
                anchor = (TextAnchor) EditorGUILayout.EnumPopup ("Text alignment:", anchor);
                textEffects = (TextEffects) EditorGUILayout.EnumPopup ("Text effect:", textEffects);
                linkedButton = EditorGUILayout.TextField ("'Enter' key's linked Button:", linkedButton);
            }
            else
            {
                uiInput = LinkedUiGUI <InputField> (uiInput, "Linked InputField:", source);
            }
            EditorGUILayout.EndVertical ();

            base.ShowGUI (source);
        }