Esempio n. 1
0
            void WindowFunction(int windowID)
            {
                GUILayout.BeginScrollView(Vector2.zero);
                var pa = PlayerAnimControl.instance;
                var pp = pa.playerParameter;

                UnityHelper.DrawText("HP", $"{pp.HP}/{pp.MAX_HP}");
                UnityHelper.DrawText("MP", $"{pp.MP}/{pp.MAX_MP}");
                UnityHelper.DrawText("ATK_MEELE", pp.ATK_MEELE);
                UnityHelper.DrawText("base_atk_meele", pp.base_atk_meele);
                UnityHelper.DrawText("equip_atk_meele", pp.EQUIP_ATK_MEELE);
                UnityHelper.DrawText("近战攻击额外%", pp.BONUS_ATK_MEELE_PERCENT);
                UnityHelper.DrawText("远程攻击", pp.ATK_BLADEBOLT);
                UnityHelper.DrawText("防御", pp.DEFENSE);
                UnityHelper.DrawText("攻击速度", pp.ATTACK_SPEED);
                UnityHelper.DrawText("移动速度", pp.RUN_SPEED);

                for (int index = 0; index < pa.buffAction.buffs.Count; ++index)
                {
                    var text  = "";
                    var cBuff = PlayerAnimControl.instance.buffAction.buffs[index];
                    if (cBuff.buffOverlap == BuffOverlap.StackedLayer || cBuff.buffOverlap == BuffOverlap.Dot)
                    {
                        text = cBuff.buffName + "-值" +
                               cBuff.value.ToString() + ":剩:" +
                               cBuff.curtimer.ToString("0.0") + "/" +
                               cBuff.excuteTime.ToString() + ":层数:" +
                               cBuff.stackLayer.ToString() + "/" +
                               cBuff.StackedLayerMaxLimit.ToString();
                    }
                    else
                    {
                        text = cBuff.buffName + "-值" +
                               cBuff.value.ToString() + ":剩:" +
                               cBuff.curtimer.ToString("0.0") + "/" +
                               cBuff.excuteTime.ToString();
                    }

                    UnityHelper.DrawText(text, fontSize: 12);
                }

                GUILayout.EndScrollView();
                GUI.DragWindow(new Rect(0, 0, 10000, 10000));
            }
Esempio n. 2
0
            /// <summary>
            /// 武器编辑窗口
            /// </summary>
            /// <param name="windowID"></param>
            void WeaponWindowFunc(int windowID)
            {
                InitWeaponGroups();
                var weapon = MagicSwordControl.instance.curMagicSword;
                var info   = TextControl.instance.MagicSwordInfo(weapon);

                UnityHelper.DrawText("名称", info[0]);
                UnityHelper.DrawText(info[1]);
                UnityHelper.DrawText("--词条--");
                if (weapon.magicSwordName != MagicSwordName.None)
                {
                    //词条
                    for (var i = 0; i < weapon.magicSwordEntrys.Count; i++)
                    {
                        int entryIdx   = i;
                        var entry      = weapon.magicSwordEntrys[i];
                        var selectName = entry.magicSwordEntryName as System.Object;
                        GUILayout.BeginHorizontal();
                        if (UnityHelper.DrawPopupToggleGroup(ref selectName, $"词条{i + 1}", weaponGroups, inline: true))
                        {
                            LogF($"{i} {entry.magicSwordEntryName} 选择了 {selectName}");
                            ChangeWeapon(i, (MagicSwordEntryName)selectName, entry.values * 100);
                            // entry.magicSwordEntryName = (MagicSwordEntryName)selectName;
                        }

                        // GUILayout.Label($"{entry.values}");
                        var entryVal = (int)(entry.values * 100);
                        if (UnityHelper.DrawField(ref entryVal))
                        {
                            LogF($"{i} {entry.magicSwordEntryName} 选择了 {entryVal}");
                            ChangeWeapon(i, entry.magicSwordEntryName, entryVal);
                        }

                        GUILayout.EndHorizontal();
                    }
                }

                GUI.DragWindow(new Rect(0, 0, 10000, 10000));
            }