Наследование: MonoBehaviour
Пример #1
0
	/// <summary>
	/// Tweens the note sprite upwards, displays the text and
	/// then waits for the user to press "Use" do hide the note
	/// </summary>
	IEnumerator showNote_CR(MyGUI.NoteSettings noteSettings){
		Messenger.Broadcast("lock player input", true );
		m_Tweening = true;
		m_TextLabel.text = noteSettings.text;
		if(m_TextLabel.height > (int)m_ScrollView.panel.height)
		{
			m_TextToLarge = true;
		}
		m_Tweener.Play( true );
		m_ScrollView.ResetPosition();
		m_ArrowDown.enabled = false;
		m_ArrowUp.enabled = false;
		while(m_Tweening){	yield return null;	}

		yield return StartCoroutine( awaitInput( "Use" ) );

		m_Tweening = true;
		m_Tweener.Play(true);
		while(m_Tweening){	yield return null;	}
		Messenger.Broadcast("lock player input", false );
		m_TextLabel.text = "";
		m_ScrollView.ResetPosition();
		m_Showing = false;
		m_TextToLarge = false;
	}
        private void OnGUI()
        {
            var selected = MyGUI.DropAreaPaths("Drag Texture", 20);

            using (new EditorGUILayout.HorizontalScope())
            {
                _width  = EditorGUILayout.IntField("Width", _width);
                _height = EditorGUILayout.IntField("Width", _height);
            }

            if (_texture != null)
            {
                EditorGUILayout.LabelField(new GUIContent(_texture), GUILayout.Width(_width), GUILayout.Height(_height));
            }

            if (selected == null || selected.Length == 0)
            {
                return;
            }

            string content = Convert.ToBase64String(File.ReadAllBytes(selected[0]));

            _representation = content;

            MyEditor.CopyToClipboard(_representation);
            ShowNotification(new GUIContent(selected[0] + "\nCopied to Clipboard as string"));

            _texture = ImageStringConverter.ImageFromString(_representation, _width, _height);
        }
        public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
        {
            if (_attribute == null)
            {
                Initialize(property);
            }
            if (_values.IsNullOrEmpty() || _selectedValueIndex < 0)
            {
                EditorGUI.PropertyField(position, property, label);
                return;
            }

            if (!_valueFound && _selectedValueIndex == 0)
            {
                MyGUI.DrawColouredRect(position, MyGUI.Colors.Yellow);
            }

            EditorGUI.BeginChangeCheck();
            _selectedValueIndex = EditorGUI.Popup(position, label.text, _selectedValueIndex, _names);
            if (EditorGUI.EndChangeCheck())
            {
                fieldInfo.SetValue(property.serializedObject.targetObject, _values[_selectedValueIndex]);
                property.serializedObject.ApplyModifiedProperties();
                EditorUtility.SetDirty(property.serializedObject.targetObject);
            }
        }
Пример #4
0
        private void DamageSkillInput(SkillData currSkillData)
        {
            #region 伤害

            MyGUIExtend.Instance.Foldout("伤害" + this.currSkillData.id + currSkillData.id, "伤害", () =>
            {
                currSkillData.atk = MyGUI.FloatFieldWithTitle("atk", currSkillData.atk);

                currSkillData.onoffDamage = MyGUI.ToggleWithTitle("是否有伤害区域", currSkillData.onoffDamage);
                if (currSkillData.onoffDamage)
                {
                    currSkillData.DamageColliderCenter =
                        MyGUI.Vector3WithTitle("伤害区域Center", currSkillData.DamageColliderCenter);
                    currSkillData.DamageColliderSize =
                        MyGUI.Vector3WithTitle("伤害区域Size", currSkillData.DamageColliderSize);
                    currSkillData.DamageDirectionType =
                        (DamageDirectionType)MyGUI.EnumPopupWithTitle("受击类型:",
                                                                      currSkillData.DamageDirectionType);
                    currSkillData.damageForceType =
                        (DamageForceType)MyGUI.EnumPopupWithTitle("伤害力度类型", currSkillData.damageForceType);
                    currSkillData.poiseCut = MyGUI.FloatFieldWithTitle("削韧", currSkillData.poiseCut);
                }

                currSkillData.Intensity      = MyGUI.FloatFieldWithTitle("击退力度", currSkillData.Intensity);
                currSkillData.angleIntensity = MyGUI.Vector3WithTitle("击退角度", currSkillData.angleIntensity);

                currSkillData.HitEffectType =
                    (HitEffectType)MyGUI.EnumPopupWithTitle("攻击效果类型", currSkillData.HitEffectType);
            });
            #endregion
        }
Пример #5
0
        private void DrawColors()
        {
            int width  = 24;
            int height = (int)EditorGUIUtility.singleLineHeight;

            var content = new GUIContent("", "MyGUI.Colors.Red");

            EditorGUILayout.LabelField(content, GUILayout.Width(width));
            MyGUI.DrawBackgroundBox(MyGUI.Colors.Red, height);

            content = new GUIContent("", "MyGUI.Colors.Green");
            EditorGUILayout.LabelField(content, GUILayout.Width(width));
            MyGUI.DrawBackgroundBox(MyGUI.Colors.Green, height);

            content = new GUIContent("", "MyGUI.Colors.Blue");
            EditorGUILayout.LabelField(content, GUILayout.Width(width));
            MyGUI.DrawBackgroundBox(MyGUI.Colors.Blue, height);

            content = new GUIContent("", "MyGUI.Colors.Gray");
            EditorGUILayout.LabelField(content, GUILayout.Width(width));
            MyGUI.DrawBackgroundBox(MyGUI.Colors.Gray, height);

            content = new GUIContent("", "MyGUI.Colors.Yellow");
            EditorGUILayout.LabelField(content, GUILayout.Width(width));
            MyGUI.DrawBackgroundBox(MyGUI.Colors.Yellow, height);

            content = new GUIContent("", "MyGUI.Colors.Brown");
            EditorGUILayout.LabelField(content, GUILayout.Width(width));
            MyGUI.DrawBackgroundBox(MyGUI.Colors.Brown, height);
        }
Пример #6
0
        private void CurrSkillDataInput(SkillData currSkillData)
        {
            currSkillData.id            = MyGUI.TextFieldWithTitle("id", currSkillData.id);
            currSkillData.IsPhasesSkill = EditorGUILayout.ToggleLeft("IsPhasesSkill:", currSkillData.IsPhasesSkill);
            if (currSkillData.IsPhasesSkill)
            {
                GUILayout.Space(10);
                GUILayout.Label("阶段1");
                BaseSkillInput(currSkillData.FrontSkillData);
                AnimSkillInput(currSkillData.FrontSkillData);

                GUILayout.Space(20);
                GUILayout.Label("阶段2");
                BaseSkillInput(currSkillData.CentreSkillData);
                DamageSkillInput(currSkillData.CentreSkillData);
                PhysicsSkillInput(currSkillData.CentreSkillData);

                GUILayout.Space(20);
                GUILayout.Label("阶段3");
                BaseSkillInput(currSkillData.BackSkillData);
                DamageSkillInput(currSkillData.BackSkillData);
                AnimSkillInput(currSkillData.BackSkillData);
            }
            else
            {
                BaseSkillInput(currSkillData);
                DamageSkillInput(currSkillData);
                PhysicsSkillInput(currSkillData);
            }
        }
 void OnGUI()
 {
     GUI.skin = skin;
     //2.1
     GUI.BeginGroup(recs2[0]);
     GUI.Label(new Rect(30, 0, 120, 26), "pass 1");
     if (MyGUI.CheckBox(new Rect(0, 0, 16, 16), texs1[0], texs1[1], ref on2[0]))
     {
         MyGUI.CheckBox(new Rect(30, 26, 16, 16), texs1[0], texs1[1], ref on20[0]);
         GUI.Label(new Rect(60, 26, 80, 26), "Set pass 1");
         MyGUI.CheckBox(new Rect(30, 50, 16, 16), texs1[0], texs1[1], ref on21[0]);
         GUI.Label(new Rect(60, 50, 80, 26), "Draw Quad");
     }
     GUI.EndGroup();
     //2.2
     GUI.BeginGroup(recs2[1]);
     GUI.Label(new Rect(30, 0, 120, 26), "pass 1+2");
     if (MyGUI.CheckBox(new Rect(0, 0, 16, 16), texs1[0], texs1[1], ref on2[1]))
     {
         MyGUI.CheckBox(new Rect(30, 26, 16, 16), texs1[0], texs1[1], ref on20[1]);
         GUI.Label(new Rect(60, 26, 80, 26), "Set pass 2");
         MyGUI.CheckBox(new Rect(30, 50, 16, 16), texs1[0], texs1[1], ref on21[1]);
         GUI.Label(new Rect(60, 50, 80, 26), "Draw Quad");
     }
     GUI.EndGroup();
     //2.3
     GUI.BeginGroup(recs2[2]);
     GUI.Label(new Rect(30, 0, 120, 26), "pass 1+2+3");
     if (MyGUI.CheckBox(new Rect(0, 0, 16, 16), texs1[0], texs1[1], ref on2[2]))
     {
         MyGUI.CheckBox(new Rect(30, 26, 16, 16), texs1[0], texs1[1], ref on20[2]);
         GUI.Label(new Rect(60, 26, 80, 26), "Set pass 3");
         MyGUI.CheckBox(new Rect(30, 50, 16, 16), texs1[0], texs1[1], ref on21[2]);
         GUI.Label(new Rect(60, 50, 80, 26), "Draw Quad");
     }
     GUI.EndGroup();
     //2.4
     GUI.BeginGroup(recs2[3]);
     GUI.Label(new Rect(30, 0, 120, 26), "pass 1+2+3+4");
     if (MyGUI.CheckBox(new Rect(0, 0, 16, 16), texs1[0], texs1[1], ref on2[3]))
     {
         MyGUI.CheckBox(new Rect(30, 26, 16, 16), texs1[0], texs1[1], ref on20[3]);
         GUI.Label(new Rect(60, 26, 80, 26), "Set pass 4");
         MyGUI.CheckBox(new Rect(30, 50, 16, 16), texs1[0], texs1[1], ref on21[3]);
         GUI.Label(new Rect(60, 50, 80, 26), "Draw Quad");
     }
     GUI.EndGroup();
     //
     //2.5
     GUI.BeginGroup(recs2[4]);
     GUI.Label(new Rect(30, 0, 120, 26), "pass 1+2+3+4+5");
     if (MyGUI.CheckBox(new Rect(0, 0, 16, 16), texs1[0], texs1[1], ref on2[4]))
     {
         MyGUI.CheckBox(new Rect(30, 26, 16, 16), texs1[0], texs1[1], ref on20[4]);
         GUI.Label(new Rect(60, 26, 80, 26), "Set pass 4");
         MyGUI.CheckBox(new Rect(30, 50, 16, 16), texs1[0], texs1[1], ref on21[4]);
         GUI.Label(new Rect(60, 50, 80, 26), "Draw Quad");
     }
     GUI.EndGroup();
 }
Пример #8
0
    void OnGUI()
    {
        GUI.skin = mySkin;
        if (MyGUI.CanShow)
        {
            float screenW = Screen.width;
            Rect  r       = new Rect(screenW - 210, 5, 100, 40);
            if (GUI.Button(r, "Inventory"))
            {
                ToggleInventoryWindow();
            }

            if (_displayInventory)
            {
                _inventoryWindowRect = MyGUI.ClampToScreen(GUI.Window(INVENTORY_WINDOW_ID,
                                                                      _inventoryWindowRect,
                                                                      inventoryWindow,
                                                                      "Inventory", "InventoryWindow"));
            }
        }

        if (showSplit)
        {
            ShowSplitStack();
        }
    }
Пример #9
0
        private void DrawPresetColourLine(Rect rect, Preset preset)
        {
            var cRect = new Rect(rect);

            cRect.width   = 6;
            cRect.height -= 2;

            Color color = MyGUI.Colors.Brown;

            if (preset == null)
            {
                color = Color.red;
            }
            else
            {
                var presetType = preset.GetTargetTypeName();
                if (presetType.Contains("Texture"))
                {
                    color = MyGUI.Colors.Blue;
                }
                else if (presetType.Contains("Audio"))
                {
                    color = MyGUI.Colors.Red;
                }
            }

            MyGUI.DrawColouredRect(cRect, color);
            EditorGUI.LabelField(cRect, GUIContent.none);
        }
Пример #10
0
        void OnGUI()
        {
            GUIStyle boxStyle = new GUIStyle("box");

            var width  = position.size.x - boxStyle.border.horizontal;
            var height = position.size.y - boxStyle.border.vertical;

            var innerBoxWidth  = width - (boxStyle.padding.horizontal + boxStyle.border.horizontal);
            var innerBoxHeight = height - (boxStyle.padding.vertical + boxStyle.border.vertical);

            EditorGUILayout.BeginVertical(boxStyle, GUILayout.Width(width), GUILayout.Height(height));

            EditorGUILayout.BeginHorizontal();
            MyGUI.TextFieldWithTitle("动画资源路径:", EffectFile);
            if (MyGUI.Button("动画资源列表刷新"))
            {
                load();
                saveskeletonAsstes();
            }
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            MyGUI.TextFieldWithTitle("动画资源列表json路径:", EffectFilejson);
            EditorGUILayout.EndHorizontal();
            EditorGUILayout.BeginVertical();
            for (int i = EffectFileList.Count - 1; i >= 0; i--)
            {
                EditorGUILayout.LabelField(EffectFileList[i]);
            }
            EditorGUILayout.EndVertical();

            EditorGUILayout.EndVertical();
        }
Пример #11
0
    public virtual void ToolBar()
    {
        GUILayout.Box("File", EditorStyles.toolbarDropDown);
        Rect fileRect = GUILayoutUtility.GetLastRect();

        if (MyGUI.ButtonMouseDown(fileRect))
        {
            var win = PopupWindow.ShowAtPosition <FileMenuPopup>(new Rect(fileRect.x, fileRect.y + fileRect.height, 50f, 60f));
            win.Setup(this);
            GUIUtility.ExitGUI();
        }

        GUILayout.Box("Window", EditorStyles.toolbarDropDown);
        Rect windowRect = GUILayoutUtility.GetLastRect();

        if (MyGUI.ButtonMouseDown(windowRect))
        {
            var win = PopupWindow.ShowAtPosition <WindowPopup>(new Rect(windowRect.x, windowRect.y + windowRect.height, 50f, 60f));
            win.Setup(Parent);
            GUIUtility.ExitGUI();
        }

        GUILayout.Box("Help", EditorStyles.toolbarDropDown);
        Rect helpRect = GUILayoutUtility.GetLastRect();

        if (MyGUI.ButtonMouseDown(helpRect))
        {
            var win = PopupWindow.ShowAtPosition <HelpPopup>(new Rect(helpRect.x, helpRect.y + windowRect.height, 100f, 60f));
            win.Setup(Parent);
            GUIUtility.ExitGUI();
        }

        GUILayout.FlexibleSpace();
    }
Пример #12
0
    /*
     * public MyGUI SetDefaultMyGUI()
     * {
     *  GUISkin defaultGUISkin = GUISkin.CreateInstance("GUISkin") as GUISkin;
     *  defaultGUISkin.name = "DefaultGUISkin";
     *  defaultGUISkin.box.normal.background = null;//Config.Instance.windowBorder;
     *  defaultGUISkin.box.border.left = windowPadding;
     *  defaultGUISkin.box.border.right = windowPadding;
     *  defaultGUISkin.box.border.top = windowPadding;
     *  defaultGUISkin.box.border.bottom = windowPadding;
     *
     *
     *  DefaultMyGUI = new MyGUI(defaultGUISkin);
     * }
     *
     * */

    void OnGUI()
    {
        if (Instance == null)
        {
            return;
        }

        foreach (KeyValuePair <int, MyGUI> keyValuePair in mMyGUIList)
        {
            MyGUI myGui = keyValuePair.Value;

            if ((myGui.TopGUICalls.Count == 0) && (myGui.BackgourndGUICalls.Count == 0))
            {
                mRemoveGUI_LayerID_List.Add(keyValuePair.Key);
                continue;
            }

            foreach (var backgourndGuiCall in myGui.BackgourndGUICalls)
            {
                backgourndGuiCall();
            }

            foreach (var topGuiCall in myGui.TopGUICalls)
            {
                topGuiCall();
            }
        }

        RemoveUnuseMyGUI(); //remove unuse myGUI which is no callback stacks;
    }
Пример #13
0
 void Start()
 {
     GUIHandler         = GameObject.FindGameObjectWithTag("GUIHandler").GetComponent <MyGUI>();
     player             = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerNew>();
     player.playerState = PlayerState.Normal;
     _stashWindowRect   = new Rect(Screen.width / 2 - 150, Screen.height / 2 - 125, 250, 290);
     selStrings         = new string[] { "Tab 1", "Tab 2", "Tab 3", "Tab 4", "Tab 5" };
 }
Пример #14
0
        public override void OnInspectorGUI()
        {
            Renderer renderer = target as Renderer;

            renderer.sortingOrder = MyGUI.IntFieldWithTitle("SortOrder", renderer.sortingOrder);

            DrawDefaultInspector();
        }
Пример #15
0
        public void OnGUI()
        {
            GUIStyle boxStyle = new GUIStyle("box");

            var width  = position.size.x - boxStyle.border.horizontal;
            var height = position.size.y - boxStyle.border.vertical;

            wwwidth = width;
            hheight = height;
            var innerBoxWidth  = width - (boxStyle.padding.horizontal + boxStyle.border.horizontal);
            var innerBoxHeight = height - (boxStyle.padding.vertical + boxStyle.border.vertical);

            Rect mSecWindowRect = new Rect(5, 5, width - 10, height - 10);

            EditorGUILayout.BeginVertical(boxStyle, GUILayout.Width(width), GUILayout.Height(height));

            diantype = (diantype)MyGUI.EnumPopupWithTitle("点或抛物线", diantype);
            if (diantype == diantype.parabola)
            {
                longlong = MyGUI.FloatFieldWithTitle("weight", longlong);
                heightf  = MyGUI.FloatFieldWithTitle("height", heightf);
            }
            else
            {
                P1put = MyGUI.Vector3WithTitle("P1", P1put);
                P2put = MyGUI.Vector3WithTitle("P2", P2put);
            }

            sort = MyGUI.FloatFieldWithTitle("点", sort);
            t    = MyGUI.FloatFieldWithTitle("t", t);
            // windowbool=MyGUI.Button("开启窗口");
            if (GUILayout.Button("开启窗口"))
            {
                GUIUtility.keyboardControl = 0;
                windowbool = true;
            }
            if (windowbool)
            {
                P0 = new Vector3((width / 2), (height / 2), 0);
                if (diantype == diantype.parabola)
                {
                    P2 = new Vector3(P0.x + longlong, P0.y, P0.z);
                    P1 = new Vector3(P0.x + longlong / 2, P0.y - heightf, P0.z);
                }
                else
                {
                    P2 = new Vector3(P0.x + P2put.x * 50, P0.y - P2put.y * 50, P0.z + P2put.z * 50);
                    P1 = new Vector3(P0.x + P1put.x * 50, P0.y - P1put.y * 50, P0.z + P1put.z * 50);
                }
                BeginWindows();
                mSecWindowRect = GUILayout.Window(354888, mSecWindowRect, DrawGraphWindow, "图形绘制", GUI.skin.window);
                EndWindows();
            }



            EditorGUILayout.EndVertical();
        }
Пример #16
0
    void Start()
    {
        GUIHandler = GameObject.FindGameObjectWithTag("GUIHandler").GetComponent <MyGUI>();
        _pc        = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerNew>();

        _characterWindowRect = new Rect(5, 120, 300, 300);
        _characterPanelNames = new string[] { "Equipment", "Attributes", "Skills" };

        inventoryWindowGUI = GameObject.FindGameObjectWithTag("GUIHandler").GetComponent <InventoryWindowGUI>();
    }
Пример #17
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     Events.instance.AddListener <SetCommandsEvent>(OnSetCommands);
     Events.instance.AddListener <ResetCommandsEvent>(OnResetCommands);
     Events.instance.AddListener <AddMilkshakesEvent>(OnAddMilkshakesEvent);
     Events.instance.AddListener <SubtractMilkshakesEvent>(OnSubtractMilkshakesEvent);
 }
Пример #18
0
 void Start()
 {
     GUIHandler               = GameObject.FindGameObjectWithTag("GUIHandler").GetComponent <MyGUI>();
     _pc                      = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerNew>();
     achievementsHandler      = GameObject.FindGameObjectWithTag("AchievementHandler").GetComponent <AchievementHandler>();
     _questWindowRect         = new Rect(Screen.width / 2 - 300, Screen.height / 2 - 200, 600, 400);
     questWindowPanels        = new string[] { "Quests", "Achievements" };
     questTrackerShowActive   = true;
     questTrackerShowComplete = true;
     playerQuests             = new List <NPCQuest>();
     ShowMiniQuestTracker     = true;
 }
Пример #19
0
 // Use this for initialization
 void Awake()
 {
     if (id == null)
     {
         id = this;
         text_next_phase.text = "Next: Opportunity";
     }
     else
     {
         Debug.LogError("Another instance of GUI is already initialized!");
     }
 }
Пример #20
0
    void OnGUI()
    {
        GUI.skin = mySkin;

        if (_displayNPCWindow)
        {
            _npcWindowRect = MyGUI.ClampToScreen(GUI.Window(NPC_WINDOW_ID,
                                                            _npcWindowRect,
                                                            npcWindow,
                                                            "", "Box")); //later can change this to variable?
        }
    }
Пример #21
0
    void Update()
    {
        if (!instance)
        {
            instance = this;
        }
        if (!isEnable)
        {
            return;
        }
        if (!tex)
        {
            tex = new Texture2D(WIDTH, HEIGHT);
        }
        Clear();

        switch (taskEnum)
        {
        case TaskEnum.ALL:
            MyDrawRect();
            MyDrawLine();
            MyDrawCircle();
            MyDrawTriangle();
            MyDrawBizierCurve();
            break;

        case TaskEnum.Rect:
            MyDrawRect();
            break;

        case TaskEnum.Line:
            MyDrawLine();
            break;

        case TaskEnum.Circle:
            MyDrawCircle();
            break;

        case TaskEnum.Triangle:
            MyDrawTriangle();
            break;

        case TaskEnum.BizierCurve:
            MyDrawBizierCurve();
            break;

        default:
            break;
        }

        tex.Apply(false);
    }
Пример #22
0
        public override void OnGUI(Rect position)
        {
            string      descriptionText = ((MyHeadAttribute)attribute).Description;
            MyEnumColor color           = ((MyHeadAttribute)attribute).TextColor;
            int         offsetX         = ((MyHeadAttribute)attribute).OffsetX;

            position.y += 4f;
            position.x += offsetX;
            Color firstColor = GUI.color;

            GUI.color = MyColor.GetColor(color);
            MyGUI.Text(position, descriptionText);
            GUI.color = firstColor;
        }
Пример #23
0
 void OnGUI()
 {
     GUI.skin = mySkin;
     if (MyGUI.CanShow)
     {
         if (_displayStashWindow)
         {
             _stashWindowRect = MyGUI.ClampToScreen(GUI.Window(STASH_WINDOW_ID,
                                                               _stashWindowRect,
                                                               stashWindow,
                                                               ""));
         }
     }
 }
Пример #24
0
        void DrawActionData(ref ActionData actionData)
        {
            GUIStyle boxStyle = new GUIStyle("box");

            EditorGUILayout.BeginVertical(boxStyle, GUILayout.ExpandWidth(true));

            actionData.type   = (ActionType)MyGUI.EnumPopupWithTitle("type", actionData.type);
            actionData.chance = MyGUI.IntFieldWithTitle("概率", actionData.chance);
            switch (actionData.type)
            {
            case ActionType.AddAttr:
                AttrType attrType = (AttrType)actionData.int1;
                attrType        = (AttrType)MyGUI.EnumPopupWithTitle("属性", attrType);
                actionData.int1 = (int)attrType;

                actionData.float1 = MyGUI.FloatFieldWithTitle("数值", actionData.float1);
                break;

            case ActionType.AddAnim:
                actionData.string1 = MyGUI.TextFieldWithTitle("动画名", actionData.string1);
                actionData.bool1   = MyGUI.ToggleWithTitle("是否循环", actionData.bool1);
                break;

            case ActionType.RemoveAnim:
                actionData.string1 = MyGUI.TextFieldWithTitle("动画名", actionData.string1);
                break;

            case ActionType.SetColor:
                actionData.float1 = MyGUI.FloatFieldWithTitle("红", actionData.float1);
                actionData.float2 = MyGUI.FloatFieldWithTitle("绿", actionData.float2);
                actionData.float3 = MyGUI.FloatFieldWithTitle("蓝", actionData.float3);
                break;

            case ActionType.CreateDamage:
                // AttrType asd = (AttrType)actionData.int1;
                actionData.vector3_1 = MyGUI.Vector3WithTitle("pos", actionData.vector3_1);
                actionData.vector3_2 = MyGUI.Vector3WithTitle("size", actionData.vector3_2);
                actionData.vector3_3 = MyGUI.Vector3WithTitle("force", actionData.vector3_3);
                HitType hittype = (HitType)actionData.int1;
                hittype         = (HitType)MyGUI.EnumPopupWithTitle("Hit Type", hittype);
                actionData.int1 = (int)hittype;
                Direction direction = (Direction)actionData.int2;
                direction       = (Direction)MyGUI.EnumPopupWithTitle("Direction", direction);
                actionData.int2 = (int)direction;
                break;
            }

            EditorGUILayout.EndVertical();
        }
Пример #25
0
    void Start()
    {
        GUIHandler = GameObject.FindGameObjectWithTag("GUIHandler").GetComponent <MyGUI>();
        _pc        = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerNew>();

        _maxInventorySpace   = _pc.MaxInventorySpace;
        _inventoryRows       = _maxInventorySpace / _inventoryCols;
        _inventoryWindowRect = new Rect((Screen.width - 5) - (itemWidth * _inventoryCols) - _offset,
                                        50,
                                        (itemWidth * _inventoryCols) + _offset,
                                        (itemHeight * _inventoryRows) + _offset + 15 + 25);

        _maxInventorySpace = _inventoryRows * _inventoryCols;
        buttonRects        = new Rect[_maxInventorySpace];
    }
Пример #26
0
        public override void OnInspectorGUI()
        {
            spriteRenderer.sortingOrder = MyGUI.IntFieldWithTitle("SortOrder", spriteRenderer.sortingOrder);

            base.DrawDefaultInspector();
            spriteRenderer.sharedMaterial = (Material)EditorGUILayout.ObjectField("Material", spriteRenderer.sharedMaterial, typeof(Material));

            if (spriteRenderer.sprite != null && spriteRenderer.sprite.texture != null)
            {
                MyGUI.FloatFieldWithTitle("Width", spriteRenderer.sprite.texture.width);
                MyGUI.FloatFieldWithTitle("Height", spriteRenderer.sprite.texture.height);
            }

            spriteRenderer.transform.localPosition = MyGUI.Vector3WithTitle("PixelPosition", spriteRenderer.transform.localPosition * 100f) / 100f;
        }
Пример #27
0
 void Awake()
 {
     Instence     = this;
     openedPanel  = new List <IClosablePanel>();
     health       = HealthBar.GetComponent <UISlider>();
     mana         = ManaBar.GetComponent <UISlider>();
     energy       = EnergyBar.GetComponent <UISlider>();
     puffPanelGUI = GetComponentInChildren <BuffPanelGUI>();
     buildBloodOnGUI.gameObject.SetActive(false);
     UICamera   = GameObject.Find("UICamera").GetComponent <Camera>();
     UIRoot     = GameObject.Find("UI Root").transform;
     MainCamera = Camera.main.transform;
     Messenger.AddListener <float, float>(MessengerTopic.PLAYER_HEALTH_UPDATE, PlayerHealthUpdate);
     Messenger.AddListener <float, float>(MessengerTopic.PLAYER_ENERGY_UPDATE, PlayerEnergyUpdate);
     Messenger.AddListener <float, float>(MessengerTopic.PLAYER_MANA_UPDATE, PlayerManaUpdate);
 }
Пример #28
0
    public bool MenuOption(string text)
    {
        var gc = new GUIContent(text);

        var rect = GUILayoutUtility.GetRect(gc, LabelStyle);

        if (rect.Contains(Event.current.mousePosition))
        {
            LabelStyle.normal.textColor = Color.red;
        }

        GUI.Label(rect, gc, LabelStyle);
        LabelStyle.normal.textColor = DefaultLabelColor;

        return(MyGUI.ButtonMouseDown(rect));
    }
Пример #29
0
    static void RemoveDrawWindow2()
    {
        AttachMyGUIBehavior();

        for (int i = 0; i < layerID; i++)
        {
            MyGUI myGUI = MyGUIBehavior.Instance.GetMyGUI(i);
            if (myGUI == null)
            {
                continue;
            }

            myGUI.RemoveGUICall(DrawWindow2, MyGUI.GUICallPriority.top);
            myGUI.RemoveGUICall(DrawWindow3, MyGUI.GUICallPriority.top);
            myGUI.RemoveGUICall(DrawWindow4, MyGUI.GUICallPriority.top);
        }
    }
Пример #30
0
    public override void OnGUI()
    {
        if (MyGUI.HasToggled(_filter.IsFilterWithRotation, "Rotate"))
        {
            _filter.IsFilterWithRotation = !_filter.IsFilterWithRotation;
            CallOnChange();
        }

        if (MyGUI.HasToggled(_filter.IsFilterExclusive, "Exclusive"))
        {
            _filter.IsFilterExclusive = !_filter.IsFilterExclusive;
            CallOnChange();
        }

        GUILayout.Space(5);

        var c = _filter.ConnectionFilter;

        if (MyGUI.HasToggled((c & ConnectionMask.Left) == ConnectionMask.Left, "Left"))
        {
            c ^= (ConnectionMask)(1 << 0);
        }

        if (MyGUI.HasToggled((c & ConnectionMask.Top) == ConnectionMask.Top, "Top"))
        {
            c ^= (ConnectionMask)(1 << 1);
        }

        if (MyGUI.HasToggled((c & ConnectionMask.Right) == ConnectionMask.Right, "Right"))
        {
            c ^= (ConnectionMask)(1 << 2);
        }

        if (MyGUI.HasToggled((c & ConnectionMask.Bottom) == ConnectionMask.Bottom, "Bottom"))
        {
            c ^= (ConnectionMask)(1 << 3);
        }

        if (c != _filter.ConnectionFilter)
        {
            _filter.ConnectionFilter = c;
            CallOnChange();
        }

        base.OnGUI();
    }
Пример #31
0
        public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
        {
            if (!property.IsNumerical())
            {
                MyGUI.DrawColouredRect(position, MyGUI.Red);
                EditorGUI.LabelField(position, new GUIContent("", "[PositiveValueOnly] used with non-numeric property"));
            }
            else
            {
                if (HandleNegativeValues(property))
                {
                    property.serializedObject.ApplyModifiedProperties();
                }
            }

            EditorGUI.PropertyField(position, property, label, true);
        }
Пример #32
0
    void Update()
    {
        if (Input.GetKey (KeyCode.Space)) {
            if (manager != null) {
                myGUI = manager.GetComponent<MyGUI>();

                if (myGUI != null) {
                    speed = myGUI.dishRotationSensitivitySlider;
                }
            }
            else {
                manager = GameObject.FindGameObjectWithTag("Manager");
            }

            //transform.Rotate(new Vector3(Input.GetAxis("Mouse Y"), Input.GetAxis("Mouse X"), 0) * Time.deltaTime * speed);
            transform.rotation = Quaternion.Euler(new Vector3(Input.GetAxis("Mouse Y"), Input.GetAxis("Mouse X"), 0) * Time.deltaTime * speed) * this.gameObject.transform.rotation;
        }
    }
Пример #33
0
	public void showNote(MyGUI.NoteSettings noteSettings){
		if( !m_Showing ){
			m_Showing = true;
			StartCoroutine("showNote_CR", noteSettings);
		}
	}
Пример #34
0
 void Start()
 {
     instance = this;
 }
Пример #35
0
    private static List<int> mRemoveGUI_LayerID_List; //save idex of GUI which need to be removed (Auto clean)

    #endregion Fields

    #region Methods

    /// <summary>
    /// Add MyGUI into list;
    /// </summary>
    /// <param name="layerID"></param>
    /// <param name="myGui"></param>
    public void AddMyGUI(int layerID, MyGUI myGui)
    {
        mMyGUIList.Add(layerID, myGui);
    }
Пример #36
0
 void Start()
 {
     _GUI = GameObject.Find("_GUI").GetComponent<MyGUI>();
 }