コード例 #1
0
    //界面打开
    protected override void OnOpen(object param = null)
    {
        if (param == null)
        {
            mOtherData = OtherDataPool.Instance.GetOtherData();
        }
        else
        {
            mOtherData = (PlayerData)param;
        }

        UpdateEquips();
        UpdatePlayerData();
        OnWingUpdate();


        if (!DataManager.PlayerTable.ContainsKey(mOtherData.resId))
        {
            return;
        }

        PlayerTableItem item = DataManager.PlayerTable[mOtherData.resId] as PlayerTableItem;

        if (item != null)
        {
            int[] equipConfigs = new int[(int)EquipSlot.EquipSlot_MAX];

            PropertyBuild.BuildEquipView(mOtherData, equipConfigs);


            mPreview.SetupCharacter(item.model, equipConfigs, mOtherData.mWingData.mWearId, uint.MaxValue);

            mPreview.ChangeWeapon(mOtherData.main_weaponId);
        }
    }
コード例 #2
0
    private void UpdatePlayerData()
    {
        if (!DataManager.LevelTable.ContainsKey(mOtherData.level))
        {
            return;
        }

        LevelTableItem levelRes = DataManager.LevelTable[mOtherData.level] as LevelTableItem;

        if (levelRes == null)
        {
            return;
        }

        PropertyOperation op  = new PropertyOperation();
        PropertyOperation pro = new PropertyOperation();

        PropertyBuild.BuildBaseProperty(mOtherData, pro);
        op.Add(pro);
        PropertyBuild.BuildEquipProperty(mOtherData, pro);
        op.Add(pro);
        PropertyBuild.BuildWeaponProperty(mOtherData, pro);
        op.Add(pro);
        PropertyBuild.BuildWingProperty(mOtherData, pro);
        op.Add(pro);

        int hp = (int)op.GetPro((int)PropertyTypeEnum.PropertyTypeMaxHP);

        mHp.text = hp.ToString();
        int mp = (int)op.GetPro((int)PropertyTypeEnum.PropertyTypeMaxMana);

        mMp.text = mp.ToString();
        int damage = (int)op.GetPro((int)PropertyTypeEnum.PropertyTypeDamage);

        mDamage.text = damage.ToString();
        int defence = (int)op.GetPro((int)PropertyTypeEnum.PropertyTypeDefance);

        mDefence.text = defence.ToString();
        int crit = (int)op.GetPro((int)PropertyTypeEnum.PropertyTypeCrticalLV);

        mCritLv.text = crit.ToString();


        uint grade = 0;

        for (int i = 0; i < mOtherData.mGrades.Grades.Length; ++i)
        {
            grade += mOtherData.mGrades[i];
        }

        mZhanli1.text = grade.ToString();
        mZhanli2.text = "战斗力:" + grade.ToString();

        mExp.text = mOtherData.exp.ToString() + "/" + levelRes.exp.ToString();

        mName.text = mOtherData.name;

        mRoleName.text = "Lv " + mOtherData.level.ToString() + "." + mOtherData.name;
    }
コード例 #3
0
    public override void Update(uint elapsed)
    {
        bool changed = false;

        //基础
        if (mMarks.Get((int)INF_PRO_TYPE.INF_PRO_TYPE_BASE))
        {
            changed = true;
            PropertyBuild.BuildBaseProperty(PlayerDataPool.Instance.MainData, mPlayerBaseProperty);
        }
        //装备
        if (mMarks.Get((int)INF_PRO_TYPE.INF_PRO_TYPE_EQUIP))
        {
            changed = true;

            PropertyBuild.BuildEquipProperty(PlayerDataPool.Instance.MainData, mPlayerEquipProperty);

            //更新外形信息
            PropertyBuild.BuildEquipView(PlayerDataPool.Instance.MainData, mEquipConfigs);

            Player player = PlayerController.Instance.GetControlObj() as Player;
            if (player != null)
            {
                player.ApplyEquipConfig(mEquipConfigs);
            }
        }
        //武器
        if (mMarks.Get((int)INF_PRO_TYPE.INF_PRO_TYPE_WEAPON))
        {
            changed = true;

            PropertyBuild.BuildWeaponProperty(PlayerDataPool.Instance.MainData, mPlayerWeaponProperty);
        }
        //翅膀
        if (mMarks.Get((int)INF_PRO_TYPE.INF_PRO_TYPE_WING))
        {
            changed = true;

            PropertyBuild.BuildWingProperty(PlayerDataPool.Instance.MainData, mPlayerWingProperty);
        }

        //时装
        if (mMarks.Get((int)INF_PRO_TYPE.INF_PRO_TYPE_FASHION))
        {
            changed = true;
            PropertyBuild.BuildFashionProperty(PlayerDataPool.Instance.MainData, mPlayerFashionProperty);
        }

        mMarks.SetAll(false);



        if (changed)
        {
            PropertyEvent evt = new PropertyEvent(PropertyEvent.PLAYER_DATA_PROPERTY_CHANGED);
            EventSystem.Instance.PushEvent(evt);
        }
    }