示例#1
0
                } // end Plus

                public void Plus(IEquipInfo info)
                {
                    if (null == info)
                    {
                        return;
                    }
                    // end if
                    XHP  = XHP + info.attributeInfo.XHP;
                    XMP  = XMP + info.attributeInfo.XMP;
                    NATK = NATK + info.attributeInfo.NATK;
                    XATK = XATK + info.attributeInfo.XATK;
                    NMGK = NMGK + info.attributeInfo.NMGK;
                    XMGK = XMGK + info.attributeInfo.XMGK;
                    HOT  = HOT + info.attributeInfo.HOT;
                    MOT  = MOT + info.attributeInfo.MOT;
                    DEF  = DEF + info.attributeInfo.DEF;
                    RGS  = RGS + info.attributeInfo.RGS;
                    if (info.attributeInfo.ASP != 0)
                    {
                        ASP = MathTool.Clamp(ASP * (info.attributeInfo.ASP + 100f) / 100f, 0.2f, 2f);
                    }
                    if (info.attributeInfo.MSP != 0)
                    {
                        MSP = MathTool.Clamp(MSP * (info.attributeInfo.MSP + 100f) / 100f, 0.2f, 5f);
                    }
                    HIT = MathTool.Clamp(HIT + info.attributeInfo.HIT, 0, 100);
                    AVD = MathTool.Clamp(AVD + info.attributeInfo.AVD, 0, 60);
                    CRT = MathTool.Clamp(CRT + info.attributeInfo.CRT, 0, 100);
                } // end Plus
示例#2
0
                } // end ReloadWeapon

                private void ReloadWing(IEquipInfo info)
                {
                    if (null == info)
                    {
                        if (null != wingGo)
                        {
                            UnityEngine.Object.Destroy(wingGo);
                        }
                        // end if
                        return;
                    } // end if
                    string     id = info.id;
                    GameObject Go = ObjectTool.InstantiateGo(id, ResourcesTool.LoadPrefab(id));

                    if (null == Go)
                    {
                        DebugTool.LogError("ReloadWing ID: " + id + " prefab is don't exsit!");
                        return;
                    } // end if
                    if (null != wingGo)
                    {
                        UnityEngine.Object.Destroy(wingGo);
                    }
                    // end if
                    wingGo = Go;
                    wingGo.transform.SetParent(wingTrans);
                    wingGo.transform.localPosition = Vector3.zero;
                    wingGo.transform.localRotation = Quaternion.identity;
                } // end ReloadWing
示例#3
0
                } // end Freshen

                private void ReloadWeapon(IEquipInfo info)
                {
                    string id;

                    if (null == info)
                    {
                        id = GameManager.playerInfo.roletype + "_weapon";
                    }
                    else
                    {
                        id = info.id;
                    }
                    // end if
                    GameObject Go = ObjectTool.InstantiateGo(id, ResourcesTool.LoadPrefab(id));

                    if (null == Go)
                    {
                        DebugTool.LogError("ReloadWeapon ID: " + id + " prefab is don't exsit!");
                        return;
                    } // end if
                    if (null != weaponGo)
                    {
                        UnityEngine.Object.Destroy(weaponGo);
                    }
                    // end if
                    weaponGo = Go;
                    FurlWeapon();
                } // end ReloadWeapon
示例#4
0
                }     // end ReloadWeapon

                private void ReloadWing(IEquipInfo info)
                {
                    if (null == info)
                    {
                        if (null != wingGo)
                        {
                            Object.Destroy(wingGo);
                        }
                        return;
                    } // end if
                    string     id = info.id;
                    GameObject Go = ObjectTool.InstantiateGo(id, ResourcesTool.LoadPrefab(id));

                    if (null == Go)
                    {
                        DebugTool.LogError("ReloadWing ID: " + id + " prefab is don't exsit!");
                        return;
                    } // end if
                    if (null != wingGo)
                    {
                        Object.Destroy(wingGo);
                    }
                    // end if
                    wingGo = Go;
                    Go.transform.SetParent(wingTrans);
                    Go.transform.localScale    = Vector3.one;
                    Go.transform.localPosition = Vector3.zero;
                    Go.transform.localRotation = Quaternion.identity;
                    Transform[] allChildren = Go.transform.GetComponentsInChildren <Transform>();
                    foreach (Transform child in allChildren)
                    {
                        child.gameObject.layer = LayerConfig.IgnoreRaycast;
                    } // end foreach
                }     // end ReloadWing
示例#5
0
                } // end ReloadEquip

                private void ReloadWeapon(IEquipInfo info)
                {
                    string id;

                    if (null == info)
                    {
                        id = roleType + "_weapon";
                    }
                    else
                    {
                        id = info.id;
                    }
                    // end if
                    GameObject Go = ObjectTool.InstantiateGo(id, ResourcesTool.LoadPrefab(id));

                    if (null == Go)
                    {
                        DebugTool.LogError("ReloadWeapon ID: " + id + " prefab is don't exsit!");
                        return;
                    } // end if
                    if (null != weaponGo)
                    {
                        Object.Destroy(weaponGo);
                    }
                    // end if
                    weaponGo = Go;
                    Go.transform.SetParent(liftTrans);
                    Go.transform.localScale    = Vector3.one;
                    Go.transform.localPosition = Vector3.zero;
                    Go.transform.localRotation = Quaternion.identity;
                    foreach (Transform child in Go.transform)
                    {
                        child.gameObject.layer = LayerConfig.IgnoreRaycast;
                    } // end foreach
                }     // end ReloadWeapon
示例#6
0
                } // end UIInfoPanel

                private void UpdateShowInfo() {
                    for (int i = 0; i < ConstConfig.EquipTypeList.Length; i++) {
                        string type = ConstConfig.EquipTypeList[i];
                        IEquipInfo info = SceneManager.mainCharacter.pack.GetWearInfo().GetEquipInfo(type);
                        if (null == info) {
                            cellDict[type].HideItem();
                            continue;
                        } // end if
                        cellDict[type].SetUIItem(ResourcesTool.LoadSprite(info.spritepath), 0);
                    } // end for
                } // end UpdateShowInfo
示例#7
0
                } // end UpdateShowInfo

                private void OnSelectedCell(string type) {
                    selected = type;
                    if (true == infoPanel.activeSelf) {
                        infoPanel.SetActive(false);
                        return;
                    } // end if
                    IEquipInfo info = SceneManager.mainCharacter.pack.GetWearInfo().GetEquipInfo(type);
                    if (null == info) return;
                    // end if
                    selector.transform.position = cellDict[type].transform.position;
                    selector.SetActive(true);
                    infoPanel.SetActive(true);
                    cellText.text = info.ToString();
                } // end OnPointerDownCell
示例#8
0
                } // end MainCharacterInfo

                private void CheckAttributeData(CenterEvent type)
                {
                    if (CenterEvent.BuffChange != type && CenterEvent.ReloadEquip != type)
                    {
                        return;
                    }
                    // end if
                    m_charcterData.Init(initArribute);
                    for (int i = 0; i < ConstConfig.EquipTypeList.Length; i++)   // 累加所有已穿戴的装备的属性
                    {
                        IEquipInfo info = mainCharacter.pack.GetWearInfo().GetEquipInfo(ConstConfig.EquipTypeList[i]);
                        if (null == info)
                        {
                            continue;
                        }
                        // end if
                        m_charcterData.Plus(info);
                    } // end for
                }     // end CheckAttributeData
示例#9
0
            } // end EnoughWithIDAndCount

            public void UseItemWithGid(int gid)
            {
                if (gid < 0 || gid >= idList.Length)
                {
                    return;
                }
                // end if
                string     itemID = idList[gid];
                IEquipInfo info   = Configs.itemConfig.GetItemInfo(itemID) as IEquipInfo;

                if (null == info || (info.role != ConstConfig.ALLROLE && info.role != roleType))
                {
                    return;                                                                              // 检测是否是装备,是否符合当前角色类型
                }
                // end if
                string type = info.type;

                if (!wearDict.ContainsKey(type))
                {
                    return;                              // 检测装备类型是否存在
                }
                // end if
                if (null == wearDict[type])
                {
                    idList[gid] = "0";
                }
                else
                {
                    idList[gid] = wearDict[type].id;
                }
                // end if
                wearDict[type] = info;
                WriteGridInfo(gid, idList[gid], 0);
                SqliteManager.SetWearInfoWithID(username, roleindex, type, info.id);
                if (null == center)
                {
                    return;
                }
                // end if
                center.Broadcast(Character.CenterEvent.ReloadEquip);
            } // end UseItemWithGid
示例#10
0
                } // end ReloadWing

                private void ReloadArmor(IEquipInfo info)
                {
                    string id;

                    if (null == info)
                    {
                        id = "0";
                    }
                    else
                    {
                        id = info.id;
                    }
                    // end if
                    Material material = ResourcesTool.LoadMaterial(GameManager.playerInfo.roletype + "_" + id);

                    if (null == material)
                    {
                        DebugTool.LogError("ReloadArmor ID: " + id + " material is don't exsit!");
                        return;
                    } // end if
                    renderer.material = material;
                }     // end ReloadArmor