/// <summary> /// 初始化武器,傳入武器ID /// </summary> public Protector(int _protectorID) : base(_protectorID) { Type = EquipmentTYpe.Protector; if (!GameDictionary.ProtectorDic.ContainsKey(ID)) { Debug.LogWarning("不存在的護具ID:" + ID); return; } ProtectorData protectorData = GameDictionary.ProtectorDic[ID]; InitEquipment(protectorData); ProType = protectorData.Type; }
ProtectorData(JsonData _item) : base(_item) { try { JsonData item = _item; foreach (string key in item.Keys) { switch (key) { case "Type": Type = (ProtectorType)Enum.Parse(typeof(ProtectorType), item[key].ToString()); break; } } } catch (Exception ex) { Debug.LogException(ex); } }