Пример #1
0
    public static void Read()
    {
        EotDataList dataList;

        bool newFile = false;

        UnityEngine.Object oldFile = AssetDatabase.LoadAssetAtPath(outputFileName, typeof(EotDataList));

        if (oldFile == null)
        {
            newFile  = true;
            dataList = ScriptableObject.CreateInstance(typeof(EotDataList)) as EotDataList;
        }
        else
        {
            dataList = oldFile as EotDataList;
        }

        dataList.dataList.Clear();

        string jsonStr = File.ReadAllText(fileName);

        JsonHashtable ht = FCJson.jsonDecode(jsonStr) as JsonHashtable;

        foreach (System.Object obj in ht.Values)
        {
            Hashtable ht2 = obj as Hashtable;

            EotData newData = new EotData();

            newData.eotID = ht2["eotId"] as string;

            for (int i = 1; i < 4; i++)
            {
                int type = (int)ht2[string.Format("eotType{0}", i)];

                if (type > -1)
                {
                    Eot eot = new Eot();
                    eot.eotType    = (Eot.EOT_TYPE)type;
                    eot.eotPercent = (float)ht2[string.Format("att{0}", i)];
                    eot.eotValue   = (float)ht2[string.Format("att{0}", i)];
                    eot.lastTime   = (float)ht2[string.Format("lastTime{0}", i)];
                    newData.eotList.Add(eot);
                }
            }

            dataList.dataList.Add(newData);
        }

        if (newFile)
        {
            AssetDatabase.CreateAsset(dataList, outputFileName);
        }
        else
        {
            EditorUtility.SetDirty(dataList);
        }
        Debug.Log(string.Format("Eot data imported OK. {0} records.", dataList.dataList.Count));
    }
Пример #2
0
    public override void AttackEnter()
    {
        if (null != SkillData)
        {
            eotData = DataManager.Instance.GetEotDataByEotID(SkillData.CurrentLevelData.eotId);

            foreach (Eot eot in eotData.eotList)
            {
                if (godTime < eot.lastTime)
                {
                    godTime = eot.lastTime;
                }
            }
        }
        else
        {
            godTime = 10.0f;
        }

        base.AttackEnter();

        showGodDown = true;
        _owner.ACOwner._avatarController.GodDownColor(godTime);
        RunScaleChange();
    }