コード例 #1
0
    /// <summary>
    /// 获取其他玩家的信息
    /// </summary>
    /// <param name="id"></param>
    private void GetShipData(ulong id)
    {
        //Debug.LogError("收到玩家信息"+id);
        ShipItemsProxy shipItemsProxy = GameFacade.Instance.RetrieveProxy(ProxyName.ShipItemsProxy) as ShipItemsProxy;
        // 飞船的
        IShip ship = shipItemsProxy.GetCurrentWarShip(id);

        if (ship != null)
        {
            IWeaponContainer weaponContainer = ship.GetWeaponContainer();
            if (weaponContainer != null)
            {
                IWeapon[] weapons = weaponContainer.GetWeapons();
                //Debug.LogError("weapons==="+weapons.Length);
                if (weapons != null)
                {
                    for (int i = 0; i < weapons.Length; i++)
                    {
                        IWeapon weapon = weapons[i];
                        m_Weapons[i].text = TableUtil.GetItemName((int)weapon.GetBaseConfig().Id);
                    }
                }
            }

            IEquipmentContainer equipmentContainer = ship.GetEquipmentContainer();
            if (equipmentContainer != null)
            {
                IEquipment[] equipments = ship.GetEquipmentContainer().GetEquipments();
                for (int i = 0; i < equipments.Length; i++)
                {
                    IEquipment equipment = equipments[i];
                    m_EquipMents[i].text = TableUtil.GetItemName((int)equipment.GetBaseConfig().Id);
                }
            }
            IReformer ireformer = ship.GetReformerContainer().GetReformer();
            if (ireformer != null)
            {
                m_Converter.text = TableUtil.GetItemName((int)ireformer.GetBaseConfig().Id);
            }
        }
        else
        {
            Debug.LogError("船的信息为空");
        }
    }
コード例 #2
0
    public PlayerSkillVO GetReformerSkill()
    {
        ShipProxy shipProxy = GameFacade.Instance.RetrieveProxy(ProxyName.ShipProxy) as ShipProxy;

        if (shipProxy.GetAppointWarShip() != null && shipProxy.GetAppointWarShip().GetReformerContainer() != null)
        {
            IReformer reformer = shipProxy.GetAppointWarShip().GetReformerContainer().GetReformer();
            if (reformer != null)
            {
                return(GetSkillByID((int)reformer.GetBaseConfig().SkillId));
            }
            else
            {
                return(null);
            }
        }

        return(null);
    }
コード例 #3
0
 /// <summary>
 /// 设置各种转化炉数据
 /// </summary>
 private void SetReformerData()
 {
     TransformUtil.FindUIObject <Transform>(m_ReformerCell, "Content").gameObject.SetActive(m_Reformer != null);
     TransformUtil.FindUIObject <Transform>(m_ReformerCell, "Empty").gameObject.SetActive(m_Reformer == null);
     if (m_Reformer != null)
     {
         //icon
         UIUtil.SetIconImage(TransformUtil.FindUIObject <Image>(m_ReformerCell, "Content/Image_Icon"), TableUtil.GetItemIconBundle(m_Reformer.GetTID()), TableUtil.GetItemIconImage(m_Reformer.GetTID()));
         //name
         TransformUtil.FindUIObject <TMP_Text>(m_ReformerCell, "Content/Label_Name").text = TableUtil.GetItemName((int)m_Reformer.GetTID());
         //quality
         TransformUtil.FindUIObject <Image>(m_ReformerCell, "Content/Image_Quality").color = ColorUtil.GetColorByItemQuality(m_Reformer.GetBaseConfig().Quality);
         //lv
         TransformUtil.FindUIObject <TMP_Text>(m_ReformerCell, "Content/Label_Lv").text = "Lv." + PadLeft(m_Reformer.GetLv().ToString());
     }
 }
コード例 #4
0
    /// <summary>
    /// 转化炉切换
    /// </summary>
    /// <param name="entityEvent"></param>
    private void ReformerWeapons(IComponentEvent entityEvent)
    {
        if (m_IPerceptronTarget.GetCurrentState().IsHasSubState(EnumSubState.Peerless))
        {
            //转化炉模式
            if (!m_SkillProxy.UsingReformer())
            {
                return;
            }

            IReformer reformer = m_SkillProxy.GetReformer();
            if (reformer == null)
            {
                return;
            }
            ulong uid = reformer.GetUID();
            if (!m_IPerceptronTarget.HaveWeaponAndCrossSight(uid))
            {
                WeaponAndCrossSight weaponAndCross = WeaponAndCrossSightFactory.CreatTWeapon(uid,
                                                                                             reformer.GetConfig().Id, reformer.GetBaseConfig().SkillId,
                                                                                             (WeaponAndCrossSight.WeaponAndCrossSightTypes)reformer.GetConfig().Reticle);

                //Debug.LogError(string.Format("创建准星 uid = {0}, tid = {1} , type = {2}, null? {3}", uid, weapon.GetConfig().Id, weapon.GetConfig().Reticle , (weaponAndCross== null)));

                if (weaponAndCross == null)
                {
                    return;
                }
                m_IPerceptronTarget.AddWeaponAndCrossSight(uid, weaponAndCross);
            }
        }
        else
        {
            //非转化炉模式
            m_IPerceptronTarget.DeleReformerWeaponAndCrossSight();
        }
    }