Ejemplo n.º 1
0
        //void parseAnimSoundAttrib(string line, AnimationSound sound)
        //{
        //    // 设置element的属性
        //    string[] vecparams = line.Split(new string[1] { "\t" }, StringSplitOptions.None);

        //    if (vecparams.Length != 2 || false == sound.setParameter(vecparams[0], vecparams[1]))
        //    {
        //        Debug.LogError("Bad Anim sound attribute line EffectManager::parseAnimSoundAttrib");
        //    }
        //}

        void parseSkillAttrib(string line, GfxSkill skill)
        {
            // 设置element的属性

            string[] szTemp = line.Split(new string[1] {
                " "
            }, StringSplitOptions.None);
            if (szTemp.Length <= 0)
            {
                Debug.LogError("the number of parameters must be >0! parseSkillAttrib " + line);
                return;
            }

            if (szTemp.Length == 2)
            {
                if (false == skill.setParameter(szTemp[0], szTemp[1]))
                {
                    Debug.LogError("Bad Anim Effect Info attribute line parseSkillAttrib " + line);
                }
            }
            else
            {
                string valueString = "";
                for (int i = 1; i < szTemp.Length; i++)
                {
                    valueString += szTemp[i];
                    if (i + 1 < szTemp.Length)
                    {
                        valueString += " ";
                    }
                }
                if (false == skill.setParameter(szTemp[0], valueString))
                {
                    Debug.LogError("Bad Anim Effect Info Complex attribute line parseSkillAttrib " + line);
                }
            }
        }
Ejemplo n.º 2
0
    void DisplaySkillGUI()
    {
        GUILayout.BeginHorizontal("box");
        GUILayout.Label("Skill");
        skillIndex = EditorGUILayout.Popup(skillIndex, SkillNames.ToArray());
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal("box");
        if (!GUILayout.Button("AddSkill"))
        {
            if (SkillNames[skillIndex] != "none")
            {
                if (lastSkillIndex != skillIndex)
                {
                    GFX.GfxSkill curSkill = GFX.GfxSkillManager.Instance.createAndParseSkillTemplate(SkillNames[skillIndex]);
                    if (curSkill != null)
                    {
                        mSkill = curSkill;
                        stat   = GUI_STATUS.CHECKING;
                        refreshSkillEffectList();
                        string curAnimateName = mSkill.getParameter("Animation");
                        mSkillAnimateNameIndex = AnimNames.IndexOf(curAnimateName);
                        if (mSkillAnimateNameIndex == -1)
                        {
                            mSkillAnimateNameIndex = 0;
                        }
                        mBreakTime      = mSkill.getParameter("BreakTime");
                        mHitTime        = mSkill.getParameter("HitTime");
                        mShakeTime      = mSkill.getParameter("ShakeTime");
                        mRepeatEffect   = mSkill.getParameter("RepeatEffect");
                        lastEffectIndex = 0;
                    }
                }
                lastSkillIndex = skillIndex;
            }
        }
        else
        {
            stat = GUI_STATUS.ADDSKILL;
        }

        if (GUILayout.Button("RemoveSkill"))
        {
            removeSkill();
        }
        GUILayout.EndHorizontal();

        switch (stat)
        {
        case GUI_STATUS.ADDEFFECT:
            addSkillEffect();
            break;

        case GUI_STATUS.ADDSKILL:
            addSkill();
            break;

        case GUI_STATUS.CHECKING:
        {
            showSkill();
            showSkillEffect();
            GUILayout.BeginHorizontal("box");
            if (GUILayout.Button("SetSkill"))
            {
                if (AnimNames[mSkillAnimateNameIndex] == "none")
                {
                    mSkill.setParameter("Animation", "");
                }
                else
                {
                    mSkill.setParameter("Animation", AnimNames[mSkillAnimateNameIndex]);
                }
                mSkill.setParameter("BreakTime", mBreakTime);
                mSkill.setParameter("HitTime", mHitTime);
                mSkill.setParameter("ShakeTime", mShakeTime);
                mSkill.setParameter("RepeatEffect", mRepeatEffect);
            }
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal("box");
            if (GUILayout.Button(GetActionName()))
            {
                SetAction();
            }
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal("box");
            if (GUILayout.Button("Save"))
            {
                Save();
            }
            GUILayout.EndHorizontal();
        }
        break;
        }
    }