Esempio n. 1
0
 public void Show()
 {
     View.transform.DetachChildren();
     RowDate = DynamicDataModel.ReadHeroData();
     ChuanWuDisPlay();
     Debug.Log(JsonMapper.ToJson(RowDate).ToString());
 }
Esempio n. 2
0
    /// <summary>
    /// 装备强化后队伍改变
    /// </summary>
    public static void EquioStrChange()
    {
        List <RowHeroDate> heroList = DynamicDataModel.ReadHeroData();

        for (int i = 0; i < heroList.Count; i++)
        {
            if (CheckIsOnTeamByPID(heroList[i]))
            {
                ChangeHeroSelf(heroList[i]);
            }
        }
    }
Esempio n. 3
0
 void Awake()
 {
     RowDate = DynamicDataModel.ReadHeroData();
 }
 void Start()
 {
     RowDate = DynamicDataModel.ReadHeroData();
     RowDate = StaticDataModel.ReadHeroDateAddEquip(RowDate);
 }
Esempio n. 5
0
    public void WearEquip(RowEquipment date)
    {
        string             json  = PlayerPrefs.GetString("HeroData");
        List <DynamicDate> HeroD = JsonMapper.ToObject <List <DynamicDate> >(json);

        switch (EquipPos)
        {
        case "W":
            for (int i = 0; i < HeroD.Count; i++)
            {
                if (HeroD[i].HeroID == EquipHero.HeroID)
                {
                    HeroD[i].WID = date.equipmentID;
                }
            }
            break;

        case "E1":
            for (int i = 0; i < HeroD.Count; i++)
            {
                if (HeroD[i].HeroID == EquipHero.HeroID)
                {
                    HeroD[i].EID_1 = date.equipmentID;
                }
            }
            break;

        case "E2":
            for (int i = 0; i < HeroD.Count; i++)
            {
                if (HeroD[i].HeroID == EquipHero.HeroID)
                {
                    HeroD[i].EID_2 = date.equipmentID;
                }
            }
            break;
        }
        string newJosn = JsonMapper.ToJson(HeroD);

        PlayerPrefs.SetString("HeroData", newJosn);

        List <RowHeroDate> newList = DynamicDataModel.ReadHeroData();

        for (int i = 0; i < newList.Count; i++)
        {
            if (EquipHero.PackageID == newList[i].PackageID)
            {
                EquipHero = newList[i];
                TeamModel.ChangeHeroSelf(EquipHero);
            }
        }

        GameObject go = Instantiate <GameObject>(Resources.Load <GameObject>("Prefabs/PlayerInfo"));

        go.transform.SetParent(GameObject.Find("UI/Canvas").transform);
        (go.transform as RectTransform).localScale    = Vector3.one;
        (go.transform as RectTransform).localPosition = Vector3.zero;
        (go.transform as RectTransform).offsetMax     = Vector2.zero;
        (go.transform as RectTransform).offsetMin     = Vector2.zero;
        go.GetComponent <PlayerInfoView>().Str_DisPlay(EquipHero);

        //GameObject.Find("UI/Canvas/chuanwu").GetComponent<ChuanwuListView>().Show();

        Destroy(gameObject);
    }