public void OnLeave()
        {
            if (m_currentState == null)
            {
                return;
            }

            if (m_sentactorEvents == null)
            {
                return;
            }

            for (int i = 0; i < m_sentactorEvents.Length; i++)
            {
                if (m_sentactorEvents[i] == false)
                {
                    if (m_currentState.EventList.Count > i && m_currentState.EventList[i] != null)
                    {
                        AnimationEventInfo animationEventInfo = m_currentState.EventList[i];
                        if (animationEventInfo.EventOnExit)
                        {
                            m_sentactorEvents[i] = true;
                        }
                        m_animationEventHandler.OnAnimationEvent(animationEventInfo.FunctionName,
                                                                 animationEventInfo.attribute);
                        EventLogger.Log(EventLogType.AnimEvent_State,
                                        string.Format("OnLeave ActorName : {0} Event : {1}_{2}, NorTime {3} ",
                                                      m_animationEventHandler.HandlerName, animationEventInfo.FunctionName,
                                                      animationEventInfo.NomalizeTime, animationEventInfo.attribute));
                    }
                }
            }
            m_currentState = null;
            m_animationEventHandler.OnAnimationEvent(AnimationEventUtil.Exit, null);
        }
    void readEnemy()
    {
        EnemyInfo = new Dictionary<string, EnemyData>();

        TextAsset textAsset = (TextAsset)Resources.Load(GameConfig.DatabasePathEnemyInfo);
        string[] temp = textAsset.text.Split('\n');

        int lenght = temp.Length;
        for (int i = 1; i < lenght - 1; i++)
        {
            if (temp[i].Equals(""))
                break;

            EnemyData data = new EnemyData();
            string[] s = temp[i].Split(';');
            data.Name = s[1].Replace('\"', ' ').ToString().Trim();
            data.Region = s[3].Replace('\"', ' ').ToString().Trim();
            data.Branch = s[4].Replace('\"', ' ').ToString().Trim();

            data.HP = (int)float.Parse(s[5]);
            data.Speed = float.Parse(s[7]);
            data.DEF = int.Parse(s[9]);
            data.Coin = (float.Parse(s[10].ToString()) - (int)(float.Parse(s[10].ToString())) >= 0.5)
                ? (int)(float.Parse(s[10].ToString())) + 1 : (int)(float.Parse(s[10].ToString()));
            data.Level = int.Parse(s[11]);
            data.Scale = int.Parse(s[16]);
            data.EXP = int.Parse(s[17]);

            string[] tempState = s[13].Split('-');
            string[] tempTimeFrame = s[14].Split('-');
            string[] tempEvent = s[15].Split(',');

            for (int k1 = 0; k1 < tempState.Length; k1++)
            {
                AnimationEventState animationState = new AnimationEventState();
                animationState.TimeFrame = float.Parse(tempTimeFrame[k1]);

                for (int k2 = 0; k2 < tempEvent.Length; k2++)
                {
                    if (tempEvent[k2] != "")
                    {
                        string[] ss = tempEvent[k2].Split('-');
                        if (tempState[k1].Equals(ss[0]))
                        {
                            for (int k3 = 1; k3 < ss.Length; k3++)
                                animationState.listKeyEventFrame.Add(ss[k3]);

                            break;
                        }
                    }
                }
                data.States.Add(tempState[k1].ToUpper(), animationState);
            }

            EnemyInfo.Add(data.Name.ToString().Trim(), data);
        }
    }
    void readObject()
    {
        ObjectInfo = new Dictionary <string, ObjectGameData>();
        TextAsset textAsset = (TextAsset)Resources.Load(GameConfig.DatabasePathObject);

        string[] temp = textAsset.text.Split('\n');

        int lenght = temp.Length;

        for (int i = 1; i <= lenght - 1; i++)
        {
            if (temp[i].Equals(""))
            {
                break;
            }

            ObjectGameData data = new ObjectGameData();
            string[]       s    = temp[i].Split(';');

            #region STATE
            string[] tempState = s[2].Split('-');
            string[] tempEvent = null;

            s[4] = s[4].Trim();
            for (int k1 = 0; k1 < tempState.Length; k1++)
            {
                AnimationEventState animationState = new AnimationEventState();

                if (!s[4].Equals("none"))
                {
                    tempEvent = s[4].Split(',');
                    for (int k2 = 0; k2 < tempEvent.Length; k2++)
                    {
                        if (tempEvent[k2] != "")
                        {
                            string[] ss = tempEvent[k2].Split('-');
                            if (tempState[k1].Equals(ss[0]))
                            {
                                for (int k3 = 1; k3 < ss.Length; k3++)
                                {
                                    animationState.listKeyEventFrame.Add(ss[k3]);
                                }

                                break;
                            }
                        }
                    }
                }
                data.States.Add(tempState[k1].ToUpper(), animationState);
            }
            #endregion

            #region TIME FRAME
            s[3] = s[3].Trim();
            if (!s[3].Equals("none"))
            {
                string[] tempTimeFrame = s[3].Split(',');

                for (int t = 0; t < tempTimeFrame.Length; t++)
                {
                    tempTimeFrame[t] = tempTimeFrame[t].Trim();
                    int index = tempTimeFrame[t].IndexOf('(');
                    if (index != -1)
                    {
                        string state = tempTimeFrame[t].Substring(0, index);
                        foreach (KeyValuePair <string, AnimationEventState> iterator in data.States)
                        {
                            if (state.ToUpper().Equals(iterator.Key))
                            {
                                string value = tempTimeFrame[t].Substring(index, tempTimeFrame[t].Length - index);
                                value = value.Substring(1, value.Length - 2); // substring '(' & ')'

                                iterator.Value.TimeFrame = float.Parse(value);
                            }
                        }
                    }
                }
            }
            #endregion

            #region SPECIFIC LOOP
            s[5] = s[5].Trim();
            string[] tempPath = s[5].Split(',');

            for (int t = 0; t < tempPath.Length; t++)
            {
                tempPath[t] = tempPath[t].Trim();
                int index = tempPath[t].IndexOf('(');
                if (index != -1)
                {
                    string state = tempPath[t].Substring(0, index);
                    foreach (KeyValuePair <string, AnimationEventState> iterator in data.States)
                    {
                        if (state.ToUpper().Equals(iterator.Key))
                        {
                            tempPath[t] = tempPath[t].Substring(index, tempPath[t].Length - index);
                            tempPath[t] = tempPath[t].Substring(1, tempPath[t].Length - 2).Trim(); // substring '(' & ')'

                            int iSpecial = tempPath[t].IndexOf('(');
                            if (iSpecial != -1)
                            {
                                iterator.Value.isSpecificLoop = true;

                                string strSpecial = tempPath[t].Substring(iSpecial, tempPath[t].Length - iSpecial);
                                strSpecial = strSpecial.Substring(1, strSpecial.Length - 2); // substring '(' & ')'

                                string[] arr = strSpecial.Split('-');
                                iterator.Value.SpecificLoopIndex = new int[arr.Length];
                                for (int m = 0; m < arr.Length; m++)
                                {
                                    iterator.Value.SpecificLoopIndex[m] = int.Parse(arr[m]);
                                }

                                tempPath[t] = tempPath[t].Substring(0, iSpecial).Trim();
                            }

                            iterator.Value.ResourcePath = tempPath[t];
                        }
                    }
                }
            }
            #endregion
            ObjectInfo.Add(s[1].ToUpper(), data);
        }
    }
    void readSkill()
    {
        SkillInfo = new Dictionary <string, SkillData>();
        TextAsset textAsset = (TextAsset)Resources.Load(GameConfig.DatabasePathSkill);

        string[] temp = textAsset.text.Split('\n');

        int lenght = temp.Length;

        for (int i = 1; i <= lenght - 1; i++)
        {
            if (temp[i].Equals(""))
            {
                break;
            }

            SkillData data = new SkillData();
            string[]  s    = temp[i].Split(';');
            data.Name     = s[2];
            data.Mana     = int.Parse(s[3]);
            data.Cooldown = float.Parse(s[4]);

            #region SKILL TYPE
            s[5] = s[5].Trim();
            string[]   tempType  = s[5].Split('-');
            ESkillType skillType = (ESkillType)Extensions.GetEnum(ESkillType.TARGET.GetType(), tempType[0].ToUpper());
            data.Type = skillType;

            if (skillType == ESkillType.TARGET || skillType == ESkillType.GLOBAL) //ATK skill
            {
                data.Ability = Extensions.GetEnum(ESkillOffense.AOE.GetType(), tempType[1].ToUpper());
            }
            else if (skillType == ESkillType.BUFF)
            {
                data.Ability = Extensions.GetEnum(ESkillBuff.PLAYER.GetType(), tempType[1].ToUpper());
            }
            #endregion

            #region STATE
            string[] tempState = s[6].Split('-');
            string[] tempEvent = null;

            s[8] = s[8].Trim();
            for (int k1 = 0; k1 < tempState.Length; k1++)
            {
                AnimationEventState animationState = new AnimationEventState();

                if (!s[8].Equals("none"))
                {
                    tempEvent = s[8].Split(',');
                    for (int k2 = 0; k2 < tempEvent.Length; k2++)
                    {
                        if (tempEvent[k2] != "")
                        {
                            string[] ss = tempEvent[k2].Split('-');
                            if (tempState[k1].Equals(ss[0]))
                            {
                                for (int k3 = 1; k3 < ss.Length; k3++)
                                {
                                    animationState.listKeyEventFrame.Add(ss[k3]);
                                }

                                break;
                            }
                        }
                    }
                }
                data.States.Add(tempState[k1].ToUpper(), animationState);
            }
            #endregion

            #region TIME FRAME
            s[7] = s[7].Trim();
            if (!s[7].Equals("none"))
            {
                string[] tempTimeFrame = s[7].Split(',');

                for (int t = 0; t < tempTimeFrame.Length; t++)
                {
                    tempTimeFrame[t] = tempTimeFrame[t].Trim();
                    int index = tempTimeFrame[t].IndexOf('(');
                    if (index != -1)
                    {
                        string state = tempTimeFrame[t].Substring(0, index);
                        foreach (KeyValuePair <string, AnimationEventState> iterator in data.States)
                        {
                            if (state.ToUpper().Equals(iterator.Key))
                            {
                                string value = tempTimeFrame[t].Substring(index, tempTimeFrame[t].Length - index);
                                value = value.Substring(1, value.Length - 2); // substring '(' & ')'

                                iterator.Value.TimeFrame = float.Parse(value);
                            }
                        }
                    }
                }
            }
            #endregion

            #region SPECIFIC LOOP
            s[9] = s[9].Trim();
            string[] tempPath = s[9].Split(',');

            for (int t = 0; t < tempPath.Length; t++)
            {
                tempPath[t] = tempPath[t].Trim();
                int index = tempPath[t].IndexOf('(');
                if (index != -1)
                {
                    string state = tempPath[t].Substring(0, index);
                    foreach (KeyValuePair <string, AnimationEventState> iterator in data.States)
                    {
                        if (state.ToUpper().Equals(iterator.Key))
                        {
                            tempPath[t] = tempPath[t].Substring(index, tempPath[t].Length - index);
                            tempPath[t] = tempPath[t].Substring(1, tempPath[t].Length - 2).Trim(); // substring '(' & ')'

                            int iSpecial = tempPath[t].IndexOf('(');
                            if (iSpecial != -1)
                            {
                                iterator.Value.isSpecificLoop = true;

                                string strSpecial = tempPath[t].Substring(iSpecial, tempPath[t].Length - iSpecial);
                                strSpecial = strSpecial.Substring(1, strSpecial.Length - 2); // substring '(' & ')'

                                string[] arr = strSpecial.Split('-');
                                iterator.Value.SpecificLoopIndex = new int[arr.Length];
                                for (int m = 0; m < arr.Length; m++)
                                {
                                    iterator.Value.SpecificLoopIndex[m] = int.Parse(arr[m]);
                                }

                                tempPath[t] = tempPath[t].Substring(0, iSpecial).Trim();
                            }

                            iterator.Value.ResourcePath = tempPath[t];
                        }
                    }
                }
            }
            #endregion

            #region VALUE
            s[10] = s[10].Trim();
            if (!s[10].Equals("none"))
            {
                string[] tempValue = s[10].Split(',');

                for (int t = 0; t < tempValue.Length; t++)
                {
                    tempValue[t] = tempValue[t].Trim();
                    int index = tempValue[t].IndexOf('(');
                    if (index != -1)
                    {
                        string state = tempValue[t].Substring(0, index);
                        foreach (KeyValuePair <string, AnimationEventState> iterator in data.States)
                        {
                            if (state.ToUpper().Equals(iterator.Key))
                            {
                                string value = tempValue[t].Substring(index, tempValue[t].Length - index);
                                value = value.Substring(1, value.Length - 2); // substring '(' & ')'
                                string[] ss = value.Trim().Split('_');
                                foreach (string eachValue in ss)
                                {
                                    string[] arrValue = eachValue.Trim().Split(':');
                                    iterator.Value.Values.Add(arrValue[0], arrValue[1]);
                                }
                            }
                        }
                    }
                }
            }
            #endregion

            SkillInfo.Add(s[1].ToUpper(), data);
        }
    }
    void readEnemy()
    {
        EnemyInfo = new Dictionary <string, EnemyData>();

        TextAsset textAsset = (TextAsset)Resources.Load(GameConfig.DatabasePathEnemyInfo);

        string[] temp = textAsset.text.Split('\n');

        int lenght = temp.Length;

        for (int i = 1; i < lenght - 1; i++)
        {
            if (temp[i].Equals(""))
            {
                break;
            }

            EnemyData data = new EnemyData();
            string[]  s    = temp[i].Split(';');
            data.Name   = s[1].Replace('\"', ' ').ToString().Trim();
            data.Region = s[3].Replace('\"', ' ').ToString().Trim();
            data.Branch = s[4].Replace('\"', ' ').ToString().Trim();

            data.HP    = (int)float.Parse(s[5]);
            data.Speed = float.Parse(s[7]);
            data.DEF   = int.Parse(s[9]);
            data.Coin  = (float.Parse(s[10].ToString()) - (int)(float.Parse(s[10].ToString())) >= 0.5)
                ? (int)(float.Parse(s[10].ToString())) + 1 : (int)(float.Parse(s[10].ToString()));
            data.Level = int.Parse(s[11]);
            data.Scale = int.Parse(s[16]);
            data.EXP   = int.Parse(s[17]);

            string[] tempState     = s[13].Split('-');
            string[] tempTimeFrame = s[14].Split('-');
            string[] tempEvent     = s[15].Split(',');

            for (int k1 = 0; k1 < tempState.Length; k1++)
            {
                AnimationEventState animationState = new AnimationEventState();
                animationState.TimeFrame = float.Parse(tempTimeFrame[k1]);

                for (int k2 = 0; k2 < tempEvent.Length; k2++)
                {
                    if (tempEvent[k2] != "")
                    {
                        string[] ss = tempEvent[k2].Split('-');
                        if (tempState[k1].Equals(ss[0]))
                        {
                            for (int k3 = 1; k3 < ss.Length; k3++)
                            {
                                animationState.listKeyEventFrame.Add(ss[k3]);
                            }

                            break;
                        }
                    }
                }
                data.States.Add(tempState[k1].ToUpper(), animationState);
            }

            EnemyInfo.Add(data.Name.ToString().Trim(), data);
        }
    }
    void readDragonPlayer()
    {
        TextAsset textAsset = (TextAsset)Resources.Load(GameConfig.DatabasePathDragonPlayer);

        string[] temp = textAsset.text.Split('\n');

        int lenght = temp.Length;

        for (int i = 1; i <= lenght - 1; i++)
        {
            if (temp[i].Equals(""))
            {
                break;
            }

            DragonPlayerData data = new DragonPlayerData();
            string[]         s    = temp[i].Split(';');
            data.Name = s[1];
            data.HP   = int.Parse(s[2]);
            data.MP   = int.Parse(s[3]);
            data.DEF  = int.Parse(s[4]);
            string[] tempATK = s[5].Split('-');
            data.ATK       = new SMinMax(int.Parse(tempATK[0]), int.Parse(tempATK[1]));
            data.ATKSpeed  = float.Parse(s[7]);
            data.MoveSpeed = float.Parse(s[8]);

            #region SKILL
            int    index     = 0;
            string skillLine = s[12].Substring(0, s[12].Length - 1);
            if (!skillLine.Equals("none"))
            {
                string[] tempSkill = s[12].Split('-');
                foreach (string skill in tempSkill)
                {
                    DragonPlayerSkillData skillData = new DragonPlayerSkillData();
                    skillData.Index = index;

                    int    indexSS = skill.IndexOf("(ss)");
                    string tempStr = skill;
                    if (indexSS == -1)
                    {
                        skillData.Ulti = false;
                    }
                    else
                    {
                        tempStr        = skill.Substring(0, indexSS);
                        skillData.Ulti = true;
                    }
                    skillData.ID = tempStr;

                    data.Skills.Add(skillData);
                    index++;
                }
            }
            #endregion

            #region STATE
            string[] tempState     = s[9].Split('-');
            string[] tempTimeFrame = s[10].Split('-');
            string[] tempEvent     = s[11].Split(',');

            for (int k1 = 0; k1 < tempState.Length; k1++)
            {
                AnimationEventState animationState = new AnimationEventState();
                animationState.TimeFrame = float.Parse(tempTimeFrame[k1]);

                for (int k2 = 0; k2 < tempEvent.Length; k2++)
                {
                    if (tempEvent[k2] != "")
                    {
                        string[] ss = tempEvent[k2].Split('-');
                        if (tempState[k1].Equals(ss[0]))
                        {
                            for (int k3 = 1; k3 < ss.Length; k3++)
                            {
                                animationState.listKeyEventFrame.Add(ss[k3]);
                            }

                            break;
                        }
                    }
                }
                data.States.Add(tempState[k1].ToUpper(), animationState);
            }
            #endregion

            string branch = s[6];
            DragonInfo.Player.Add(branch.ToUpper(), data);
        }
    }
    object getValueFromDatabase(EAnimationDataType type)
    {
        object result = null;

        if (type == EAnimationDataType.TIME_FRAME)
        {
            result = ReadDatabase.Instance.SkillInfo[controller.ID.ToUpper()].States[currentState.ToString().ToUpper()].TimeFrame;
        }
        else if (type == EAnimationDataType.EVENT)
        {
            if (ReadDatabase.Instance.SkillInfo[controller.ID.ToUpper()].States[currentState.ToString().ToUpper()].listKeyEventFrame.Count > 0)
            {
                System.Collections.Generic.List <object> listEvent = null;
                listEvent = ReadDatabase.Instance.SkillInfo[controller.ID.ToUpper()].States[currentState.ToString().ToUpper()].listKeyEventFrame;

                int length = listEvent.Count;
                for (int i = 0; i < length; i++)
                {
                    if (listEvent[i].Equals("end"))
                    {
                        listEvent[i] = animationFrames.keyEnd;
                    }
                }

                result = listEvent.ToArray();
            }
        }
        else if (type == EAnimationDataType.RESOURCE_PATH)
        {
            string s = ReadDatabase.Instance.SkillInfo[controller.ID.ToUpper()].States[currentState.ToString().ToUpper()].ResourcePath;
            if ((ESkillAction)currentState == ESkillAction.EXPLOSION) // Explosion texture
            {
                string[] arr = s.Split(' ');
                result = ConvertSupportor.convertUpperFirstChar(arr[0]) + "/" + arr[1];
            }
            else // Skill texture
            {
                result = s;
            }
        }
        else if (type == EAnimationDataType.SPECIFIC_LOOP)
        {
            bool  boolResult = false;
            int[] arrResult  = null;

            AnimationEventState eventState = ReadDatabase.Instance.SkillInfo[controller.ID.ToUpper()].States[currentState.ToString().ToUpper()];
            boolResult = eventState.isSpecificLoop;

            if (boolResult)
            {
                arrResult = new int[eventState.SpecificLoopIndex.Length];
                for (int i = 0; i < eventState.SpecificLoopIndex.Length; i++)
                {
                    arrResult[i] = eventState.SpecificLoopIndex[i];
                }
            }

            result = new object[] { boolResult, arrResult };
        }
        return(result);
    }
    void readObject()
    {
        ObjectInfo = new Dictionary<string, ObjectGameData>();
        TextAsset textAsset = (TextAsset)Resources.Load(GameConfig.DatabasePathObject);
        string[] temp = textAsset.text.Split('\n');

        int lenght = temp.Length;
        for (int i = 1; i <= lenght - 1; i++)
        {
            if (temp[i].Equals(""))
                break;

            ObjectGameData data = new ObjectGameData();
            string[] s = temp[i].Split(';');

            #region STATE
            string[] tempState = s[2].Split('-');
            string[] tempEvent = null;

            s[4] = s[4].Trim();
            for (int k1 = 0; k1 < tempState.Length; k1++)
            {
                AnimationEventState animationState = new AnimationEventState();

                if (!s[4].Equals("none"))
                {
                    tempEvent = s[4].Split(',');
                    for (int k2 = 0; k2 < tempEvent.Length; k2++)
                    {
                        if (tempEvent[k2] != "")
                        {
                            string[] ss = tempEvent[k2].Split('-');
                            if (tempState[k1].Equals(ss[0]))
                            {
                                for (int k3 = 1; k3 < ss.Length; k3++)
                                    animationState.listKeyEventFrame.Add(ss[k3]);

                                break;
                            }
                        }
                    }
                }
                data.States.Add(tempState[k1].ToUpper(), animationState);
            }
            #endregion

            #region TIME FRAME
            s[3] = s[3].Trim();
            if (!s[3].Equals("none"))
            {
                string[] tempTimeFrame = s[3].Split(',');

                for (int t = 0; t < tempTimeFrame.Length; t++)
                {
                    tempTimeFrame[t] = tempTimeFrame[t].Trim();
                    int index = tempTimeFrame[t].IndexOf('(');
                    if (index != -1)
                    {
                        string state = tempTimeFrame[t].Substring(0, index);
                        foreach (KeyValuePair<string, AnimationEventState> iterator in data.States)
                        {
                            if (state.ToUpper().Equals(iterator.Key))
                            {
                                string value = tempTimeFrame[t].Substring(index, tempTimeFrame[t].Length - index);
                                value = value.Substring(1, value.Length - 2); // substring '(' & ')'

                                iterator.Value.TimeFrame = float.Parse(value);
                            }
                        }
                    }
                }
            }
            #endregion

            #region SPECIFIC LOOP
            s[5] = s[5].Trim();
            string[] tempPath = s[5].Split(',');

            for (int t = 0; t < tempPath.Length; t++)
            {
                tempPath[t] = tempPath[t].Trim();
                int index = tempPath[t].IndexOf('(');
                if (index != -1)
                {
                    string state = tempPath[t].Substring(0, index);
                    foreach (KeyValuePair<string, AnimationEventState> iterator in data.States)
                    {
                        if (state.ToUpper().Equals(iterator.Key))
                        {
                            tempPath[t] = tempPath[t].Substring(index, tempPath[t].Length - index);
                            tempPath[t] = tempPath[t].Substring(1, tempPath[t].Length - 2).Trim(); // substring '(' & ')'

                            int iSpecial = tempPath[t].IndexOf('(');
                            if (iSpecial != -1)
                            {
                                iterator.Value.isSpecificLoop = true;

                                string strSpecial = tempPath[t].Substring(iSpecial, tempPath[t].Length - iSpecial);
                                strSpecial = strSpecial.Substring(1, strSpecial.Length - 2); // substring '(' & ')'

                                string[] arr = strSpecial.Split('-');
                                iterator.Value.SpecificLoopIndex = new int[arr.Length];
                                for (int m = 0; m < arr.Length; m++)
                                {
                                    iterator.Value.SpecificLoopIndex[m] = int.Parse(arr[m]);
                                }

                                tempPath[t] = tempPath[t].Substring(0, iSpecial).Trim();
                            }

                            iterator.Value.ResourcePath = tempPath[t];
                        }
                    }
                }
            }
            #endregion
            ObjectInfo.Add(s[1].ToUpper(), data);
        }
    }
    void readSkill()
    {
        SkillInfo = new Dictionary<string, SkillData>();
        TextAsset textAsset = (TextAsset)Resources.Load(GameConfig.DatabasePathSkill);
        string[] temp = textAsset.text.Split('\n');

        int lenght = temp.Length;
        for (int i = 1; i <= lenght - 1; i++)
        {
            if (temp[i].Equals(""))
                break;

            SkillData data = new SkillData();
            string[] s = temp[i].Split(';');
            data.Name = s[2];
            data.Mana = int.Parse(s[3]);
            data.Cooldown = float.Parse(s[4]);

            #region SKILL TYPE
            s[5] = s[5].Trim();
            string[] tempType = s[5].Split('-');
            ESkillType skillType = (ESkillType)Extensions.GetEnum(ESkillType.TARGET.GetType(), tempType[0].ToUpper());
            data.Type = skillType;

            if (skillType == ESkillType.TARGET || skillType == ESkillType.GLOBAL) //ATK skill
            {
                data.Ability = Extensions.GetEnum(ESkillOffense.AOE.GetType(), tempType[1].ToUpper());
            }
            else if (skillType == ESkillType.BUFF)
            {
                data.Ability = Extensions.GetEnum(ESkillBuff.PLAYER.GetType(), tempType[1].ToUpper());
            }
            #endregion

            #region STATE
            string[] tempState = s[6].Split('-');
            string[] tempEvent = null;

            s[8] = s[8].Trim();
            for (int k1 = 0; k1 < tempState.Length; k1++)
            {
                AnimationEventState animationState = new AnimationEventState();

                if (!s[8].Equals("none"))
                {
                    tempEvent = s[8].Split(',');
                    for (int k2 = 0; k2 < tempEvent.Length; k2++)
                    {
                        if (tempEvent[k2] != "")
                        {
                            string[] ss = tempEvent[k2].Split('-');
                            if (tempState[k1].Equals(ss[0]))
                            {
                                for (int k3 = 1; k3 < ss.Length; k3++)
                                    animationState.listKeyEventFrame.Add(ss[k3]);

                                break;
                            }
                        }
                    }
                }
                data.States.Add(tempState[k1].ToUpper(), animationState);
            }
            #endregion

            #region TIME FRAME
            s[7] = s[7].Trim();
            if (!s[7].Equals("none"))
            {
                string[] tempTimeFrame = s[7].Split(',');

                for (int t = 0; t < tempTimeFrame.Length; t++)
                {
                    tempTimeFrame[t] = tempTimeFrame[t].Trim();
                    int index = tempTimeFrame[t].IndexOf('(');
                    if (index != -1)
                    {
                        string state = tempTimeFrame[t].Substring(0, index);
                        foreach (KeyValuePair<string, AnimationEventState> iterator in data.States)
                        {
                            if (state.ToUpper().Equals(iterator.Key))
                            {
                                string value = tempTimeFrame[t].Substring(index, tempTimeFrame[t].Length - index);
                                value = value.Substring(1, value.Length - 2); // substring '(' & ')'

                                iterator.Value.TimeFrame = float.Parse(value);
                            }
                        }
                    }
                }
            }
            #endregion

            #region SPECIFIC LOOP
            s[9] = s[9].Trim();
            string[] tempPath = s[9].Split(',');

            for (int t = 0; t < tempPath.Length; t++)
            {
                tempPath[t] = tempPath[t].Trim();
                int index = tempPath[t].IndexOf('(');
                if (index != -1)
                {
                    string state = tempPath[t].Substring(0, index);
                    foreach (KeyValuePair<string, AnimationEventState> iterator in data.States)
                    {
                        if (state.ToUpper().Equals(iterator.Key))
                        {
                            tempPath[t] = tempPath[t].Substring(index, tempPath[t].Length - index);
                            tempPath[t] = tempPath[t].Substring(1, tempPath[t].Length - 2).Trim(); // substring '(' & ')'

                            int iSpecial = tempPath[t].IndexOf('(');
                            if (iSpecial != -1)
                            {
                                iterator.Value.isSpecificLoop = true;

                                string strSpecial = tempPath[t].Substring(iSpecial, tempPath[t].Length - iSpecial);
                                strSpecial = strSpecial.Substring(1, strSpecial.Length - 2); // substring '(' & ')'

                                string[] arr = strSpecial.Split('-');
                                iterator.Value.SpecificLoopIndex = new int[arr.Length];
                                for (int m = 0; m < arr.Length; m++)
                                {
                                    iterator.Value.SpecificLoopIndex[m] = int.Parse(arr[m]);
                                }

                                tempPath[t] = tempPath[t].Substring(0, iSpecial).Trim();
                            }

                            iterator.Value.ResourcePath = tempPath[t];
                        }
                    }
                }
            }
            #endregion

            #region VALUE
            s[10] = s[10].Trim();
            if (!s[10].Equals("none"))
            {
                string[] tempValue = s[10].Split(',');

                for (int t = 0; t < tempValue.Length; t++)
                {
                    tempValue[t] = tempValue[t].Trim();
                    int index = tempValue[t].IndexOf('(');
                    if (index != -1)
                    {
                        string state = tempValue[t].Substring(0, index);
                        foreach (KeyValuePair<string, AnimationEventState> iterator in data.States)
                        {
                            if (state.ToUpper().Equals(iterator.Key))
                            {
                                string value = tempValue[t].Substring(index, tempValue[t].Length - index);
                                value = value.Substring(1, value.Length - 2); // substring '(' & ')'
                                string[] ss = value.Trim().Split('_');
                                foreach (string eachValue in ss)
                                {
                                    string[] arrValue = eachValue.Trim().Split(':');
                                    iterator.Value.Values.Add(arrValue[0], arrValue[1]);
                                }
                            }
                        }
                    }
                }
            }
            #endregion

            SkillInfo.Add(s[1].ToUpper(), data);
        }
    }
    void readDragonPlayer()
    {
        TextAsset textAsset = (TextAsset)Resources.Load(GameConfig.DatabasePathDragonPlayer);
        string[] temp = textAsset.text.Split('\n');

        int lenght = temp.Length;
        for (int i = 1; i <= lenght - 1; i++)
        {
            if (temp[i].Equals(""))
                break;

            DragonPlayerData data = new DragonPlayerData();
            string[] s = temp[i].Split(';');
            data.Name = s[1];
            data.HP = int.Parse(s[2]);
            data.MP = int.Parse(s[3]);
            data.DEF = int.Parse(s[4]);
            string[] tempATK = s[5].Split('-');
            data.ATK = new SMinMax(int.Parse(tempATK[0]), int.Parse(tempATK[1]));
            data.ATKSpeed = float.Parse(s[7]);
            data.MoveSpeed = float.Parse(s[8]);

            #region SKILL
            int index = 0;
            string skillLine = s[12].Substring(0, s[12].Length - 1);
            if (!skillLine.Equals("none"))
            {
                string[] tempSkill = s[12].Split('-');
                foreach (string skill in tempSkill)
                {
                    DragonPlayerSkillData skillData = new DragonPlayerSkillData();
                    skillData.Index = index;

                    int indexSS = skill.IndexOf("(ss)");
                    string tempStr = skill;
                    if (indexSS == -1)
                        skillData.Ulti = false;
                    else
                    {
                        tempStr = skill.Substring(0, indexSS);
                        skillData.Ulti = true;
                    }
                    skillData.ID = tempStr;

                    data.Skills.Add(skillData);
                    index++;
                }
            }
            #endregion

            #region STATE
            string[] tempState = s[9].Split('-');
            string[] tempTimeFrame = s[10].Split('-');
            string[] tempEvent = s[11].Split(',');

            for (int k1 = 0; k1 < tempState.Length; k1++)
            {
                AnimationEventState animationState = new AnimationEventState();
                animationState.TimeFrame = float.Parse(tempTimeFrame[k1]);

                for (int k2 = 0; k2 < tempEvent.Length; k2++)
                {
                    if (tempEvent[k2] != "")
                    {
                        string[] ss = tempEvent[k2].Split('-');
                        if (tempState[k1].Equals(ss[0]))
                        {
                            for (int k3 = 1; k3 < ss.Length; k3++)
                                animationState.listKeyEventFrame.Add(ss[k3]);

                            break;
                        }
                    }
                }
                data.States.Add(tempState[k1].ToUpper(), animationState);
            }
            #endregion

            string branch = s[6];
            DragonInfo.Player.Add(branch.ToUpper(), data);
        }
    }
 public void OnEnter(AnimationEventState state)
 {
     m_currentState = state;
     m_animationEventHandler.OnAnimationEvent(AnimationEventUtil.Enter, null);
     ResetAniTime();
 }