Пример #1
0
    public virtual void SetID(int id)
    {
        animator        = GetComponent <Animator>();
        ID              = id;
        RanchAnimalInfo = RanchnManager.Instance.GetRanchAnimalInfoByID(ID);
        RanchnManager.Instance.RanchAnimalUIList.Add(this);


        GetAnimation(RanchAnimalInfo.Animation);
        RandomMove();
    }
Пример #2
0
    private void ParseRanchAnimalInfo()
    {
        TextAsset  ranchAnimalText = Resources.Load <TextAsset>("Json/RanchAnimalInfo");
        string     ranchAnimalJson = ranchAnimalText.text;
        JSONObject j = new JSONObject(ranchAnimalJson);

        foreach (JSONObject temp in j.list)
        {
            int             id              = (int)temp["id"].n;
            string          name            = temp["name"].str;
            string          animation       = temp["animation"].str;
            int             daygrow         = (int)temp["daygrow"].n;
            int             maxgrow         = (int)temp["maxgrow"].n;
            int             productid       = (int)temp["productid"].n;
            RanchAnimalInfo ranchAnimalInfo = new RanchAnimalInfo(id, name, animation, daygrow, maxgrow, productid);
            RanchAnimalInfoList.Add(ranchAnimalInfo);
        }
    }