少年修仙传客户端代码仓库
client_Wu Xijin
2019-02-25 dbf5fe281bea65b166b05dc783f50a9eda2ce04b
3335 新版装备开发。
7个文件已添加
1个文件已修改
246 ■■■■■ 已修改文件
System/Equip.meta 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Equip/EquipModel.cs 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Equip/EquipModel.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Equip/EquipSet.cs 160 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Equip/EquipSet.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Equip/EquipSlot.cs 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Equip/EquipSlot.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/WindowBase/ModelCenter.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Equip.meta
New file
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 408cda0fe9174ca4eac9ce32502fdcb0
folderAsset: yes
timeCreated: 1551096728
licenseType: Pro
DefaultImporter:
  userData:
  assetBundleName:
  assetBundleVariant:
System/Equip/EquipModel.cs
New file
@@ -0,0 +1,24 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Snxxz.UI
{
    public class EquipModel : Model
    {
        Dictionary<int, EquipSet> equipSets = new Dictionary<int, EquipSet>();
        public override void Init()
        {
        }
        public override void UnInit()
        {
        }
    }
}
System/Equip/EquipModel.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: f3ee6b5bd5b76714b87a241feedd3937
timeCreated: 1551096748
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
System/Equip/EquipSet.cs
New file
@@ -0,0 +1,160 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Snxxz.UI
{
    public class EquipSet
    {
        public readonly int level;
        public bool unLocked { get; set; }
        Redpoint redpoint = new Redpoint(1);
        Dictionary<int, EquipSlot> equipSlots = new Dictionary<int, EquipSlot>();
        public EquipSet(int level)
        {
            this.level = level;
        }
        public void UnLock()
        {
        }
        public void UpdateEquipSlots()
        {
        }
        public bool IsSlotUnLocked(int place)
        {
            if (!equipSlots.ContainsKey(place))
            {
                return false;
            }
            return equipSlots[place].unLocked;
        }
        public int GetStarLevel(int place)
        {
            if (!equipSlots.ContainsKey(place))
            {
                return 0;
            }
            return equipSlots[place].starLevel;
        }
        public ItemModel GetEquip(int place)
        {
            if (!equipSlots.ContainsKey(place))
            {
                return null;
            }
            return equipSlots[place].equip;
        }
        public void PutOn(int place, ItemModel item)
        {
            if (item == null)
            {
                return;
            }
            if (!equipSlots.ContainsKey(place))
            {
                return;
            }
            var slot = equipSlots[place];
            if (!slot.unLocked)
            {
                return;
            }
            if (!IsPlaceCompatible(place, item.equipPlace))
            {
                return;
            }
            slot.equip = item;
        }
        public void TakeOff(int place)
        {
            if (!equipSlots.ContainsKey(place))
            {
                return;
            }
            var slot = equipSlots[place];
            slot.equip = null;
        }
        public void UpdateStarLevel(int place, int starLevel)
        {
            if (!equipSlots.ContainsKey(place))
            {
                return;
            }
            var slot = equipSlots[place];
            slot.starLevel = starLevel;
        }
        public void UnLockSlot(int place)
        {
            if (!equipSlots.ContainsKey(place))
            {
                return;
            }
            var slot = equipSlots[place];
            if (slot.unLocked)
            {
                return;
            }
            slot.unLocked = true;
        }
        public bool IsBetterThanCurrent(ItemModel item)
        {
            var place = item.equipPlace;
            if (!equipSlots.ContainsKey(place))
            {
                return false;
            }
            var slot = equipSlots[place];
            if (slot.unLocked)
            {
                return false;
            }
            var currentEquip = slot.equip;
            if (currentEquip == null)
            {
                return true;
            }
            return item.equipScore >= currentEquip.equipScore;
        }
        private bool IsPlaceCompatible(int slotPlace, int equipPlace)
        {
            slotPlace = slotPlace == 10 ? 9 : slotPlace;
            equipPlace = equipPlace == 10 ? 9 : equipPlace;
            return slotPlace == equipPlace;
        }
    }
}
System/Equip/EquipSet.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 5e6ca401fb2c59844b89e981c4a58bc0
timeCreated: 1551096917
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
System/Equip/EquipSlot.cs
New file
@@ -0,0 +1,16 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Snxxz.UI
{
    public class EquipSlot
    {
        public bool unLocked { get; set; }
        public int starLevel { get; set; }
        public ItemModel equip { get;  set; }
    }
}
System/Equip/EquipSlot.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: e1fa9aacd2e109c4c954083ce08738e4
timeCreated: 1551097235
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
System/WindowBase/ModelCenter.cs
@@ -229,6 +229,7 @@
            RegisterModel<NewYearFairylandCeremonyModel>();
            RegisterModel<JadeDynastyGemModel>();
            RegisterModel<LuckyTreasureModel>();
            RegisterModel<EquipModel>();
            inited = true;
        }