Пример #1
0
        private void DoEventLine(SkillEvent fsmEvent)
        {
            int num;

            this.usageCount.TryGetValue(fsmEvent, ref num);
            if (num == 0 && FsmEditorSettings.HideUnusedEvents)
            {
                return;
            }
            GUILayout.BeginHorizontal((this.selectedEvent != null && fsmEvent.get_Name() == this.selectedEvent.get_Name()) ? SkillEditorStyles.SelectedEventBox : SkillEditorStyles.TableRowBox, new GUILayoutOption[0]);
            EditorGUI.BeginDisabledGroup(fsmEvent.get_IsSystemEvent());
            bool flag = GUILayout.Toggle(fsmEvent.get_IsGlobal(), new GUIContent("", Strings.get_Label_Global()), SkillEditorStyles.TableRowCheckBox, new GUILayoutOption[]
            {
                GUILayout.MaxWidth(17f),
                GUILayout.MinWidth(17f)
            });

            if (flag != fsmEvent.get_IsGlobal())
            {
                SkillEditor.Builder.SetEventIsGlobal(null, fsmEvent, flag);
            }
            EditorGUI.EndDisabledGroup();
            GUIStyle gUIStyle = (this.selectedEvent != null && fsmEvent.get_Name() == this.selectedEvent.get_Name()) ? SkillEditorStyles.TableRowTextSelected : SkillEditorStyles.TableRowText;

            if (GUILayout.Button(fsmEvent.get_Name(), gUIStyle, new GUILayoutOption[]
            {
                GUILayout.MinWidth(base.get_position().get_width() - 100f)
            }))
            {
                this.SelectEvent(fsmEvent);
                if (Event.get_current().get_button() == 1 || EditorGUI.get_actionKey())
                {
                    this.GenerateUsageContextMenu(this.selectedEvent).ShowAsContext();
                }
                if (EditorApplication.get_timeSinceStartup() - this.clickTime < 0.3)
                {
                    this.AddSelectedEventToState();
                }
                this.clickTime = EditorApplication.get_timeSinceStartup();
            }
            GUILayout.FlexibleSpace();
            GUILayout.Label(num.ToString(CultureInfo.get_CurrentCulture()), gUIStyle, new GUILayoutOption[0]);
            GUILayout.Space(10f);
            EditorGUI.BeginDisabledGroup(fsmEvent.get_IsSystemEvent());
            if (SkillEditorGUILayout.DeleteButton() && Dialogs.YesNoDialog(Strings.get_Dialog_Delete_Event(), string.Format(Strings.get_Dialog_Delete_Event_Are_you_sure(), (num > 0) ? string.Concat(new object[]
            {
                "\n\n",
                Strings.get_Dialog_Delete_Event_Used_By(),
                num,
                (num > 1) ? Strings.get_Label_Postfix_FSMs_Plural() : Strings.get_Label_Postfix_FSM()
            }) : "")))
            {
                EditorCommands.DeleteEventFromAll(fsmEvent);
                SkillEditor.EventManager.Reset();
                SkillEvent.RemoveEventFromEventList(fsmEvent);
                if (fsmEvent.get_IsGlobal())
                {
                    SkillEvent.get_globalEvents().RemoveAll((string r) => r == fsmEvent.get_Name());
                    SkillEditor.SaveGlobals();
                }
                this.BuildFilteredList();
                base.Repaint();
            }
            EditorGUI.EndDisabledGroup();
            GUILayout.EndHorizontal();
        }
Пример #2
0
 public void ChangeState(SkillEvent fsmEvent)
 {
     this.fsm.Event(fsmEvent);
 }
Пример #3
0
    void LaunchEvent(SkillEvent evt)
    {
        ////TraceUtil.Log("--skill event--:  " + evt.Type.ToString() + "---" + evt.Param.ToString());

        switch (evt.Type)
        {
        case SkillEventType.DoAction:
        {
            if (null != onDoAction)
            {
                m_currentActionThresHold = m_skillActionList[evt.Param].m_actionData.m_threshold;
                onDoAction(m_skillActionList[evt.Param].m_actionData);
            }
            else
            {
                TraceUtil.Log(SystemModel.Common, TraceLevel.Error, "怪物动作参数:" + evt.Param.ToString() + " 不存在");
                TraceUtil.Log(SystemModel.NotFoundInTheDictionary, TraceLevel.Error, "怪物动作参数:" + evt.Param.ToString() + " 不存在");
            }
        }
        break;

        case SkillEventType.FireBullet:
        {
            FireBullet(evt.Param);
        }
        break;

        case SkillEventType.PlayViewEffect:
        {
            PlayActionEffect(evt.Param);
        }
        break;

        case SkillEventType.PlaySoundEffect:
        {
            PlaySoundEffect(evt.Param);
        }
        break;

        case SkillEventType.FireRangeDamage:
        {
            FireRangeDamage(evt.Param);
        }
        break;

        case SkillEventType.SkillOver:
        {
            Stop();
        }
        break;

        case SkillEventType.PlayUIEffect:
        {
            var playerData = PlayerManager.Instance.FindHeroDataModel();
            if (playerData.UID == m_UserID)
            {
                PlayUIEffect(evt.Param);
            }
        }
        break;

        default:
            break;
        }
    }
 public void Show(SkillEvent se)
 {
     this._se = se;
     base.Show();
 }
Пример #5
0
        public static void OnGUI()
        {
            EditorGUI.BeginChangeCheck();
            Skill fsm = SkillEditor.SelectedFsm;

            if (fsm == null)
            {
                GUILayout.FlexibleSpace();
                return;
            }
            if (!FsmInspector.isInitialized)
            {
                FsmInspector.isInitialized = true;
                FsmInspector.Init();
            }
            FsmInspector.scrollViewPosition = GUILayout.BeginScrollView(FsmInspector.scrollViewPosition, new GUILayoutOption[0]);
            EditorGUI.BeginChangeCheck();
            fsm.set_Name(EditorGUILayout.TextField(fsm.get_Name(), new GUILayoutOption[0]));
            if (EditorGUI.EndChangeCheck())
            {
                Labels.Update(fsm);
            }
            if (fsm.get_Owner() != null)
            {
                GUILayout.BeginHorizontal(new GUILayoutOption[0]);
                SkillTemplate fsmTemplate = (SkillTemplate)EditorGUILayout.ObjectField(FsmInspector.SelectedTemplate, typeof(SkillTemplate), false, new GUILayoutOption[0]);
                if (fsmTemplate != FsmInspector.SelectedTemplate)
                {
                    FsmInspector.SelectTemplate(fsmTemplate);
                }
                if (GUILayout.Button(SkillEditorContent.BrowseTemplateButton, new GUILayoutOption[]
                {
                    GUILayout.MaxWidth(30f),
                    GUILayout.Height(16f)
                }))
                {
                    Templates.DoSelectTemplateMenu(FsmInspector.SelectedTemplate, new GenericMenu.MenuFunction(FsmInspector.ClearTemplate), new GenericMenu.MenuFunction2(FsmInspector.SelectTemplate));
                }
                GUILayout.EndHorizontal();
            }
            EditorGUI.BeginDisabledGroup(!Application.get_isPlaying() && SkillEditor.SelectedFsmUsesTemplate);
            if (fsm.get_Template() != null)
            {
                fsm = fsm.get_Template().fsm;
            }
            fsm.set_Description(SkillEditorGUILayout.TextAreaWithHint(fsm.get_Description(), Strings.get_Label_Description___(), new GUILayoutOption[]
            {
                GUILayout.MinHeight(80f)
            }));
            EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]);
            fsm.set_DocUrl(SkillEditorGUILayout.TextFieldWithHint(fsm.get_DocUrl(), Strings.get_Tooltip_Documentation_Url(), new GUILayoutOption[0]));
            EditorGUI.BeginDisabledGroup(!string.IsNullOrEmpty(fsm.get_DocUrl()));
            if (SkillEditorGUILayout.HelpButton("Online Help"))
            {
                Application.OpenURL(fsm.get_DocUrl());
            }
            EditorGUI.EndDisabledGroup();
            EditorGUILayout.EndHorizontal();
            EditorGUI.BeginDisabledGroup(!Application.get_isPlaying() && SkillEditor.SelectedFsmUsesTemplate);
            fsm.set_MaxLoopCountOverride(EditorGUILayout.IntField(SkillEditorContent.MaxLoopOverrideLabel, fsm.get_MaxLoopCountOverride(), new GUILayoutOption[0]));
            fsm.RestartOnEnable = GUILayout.Toggle(fsm.RestartOnEnable, SkillEditorContent.ResetOnDisableLabel, new GUILayoutOption[0]);
            EditorGUI.EndDisabledGroup();
            EditorGUI.EndDisabledGroup();
            fsm = SkillEditor.SelectedFsm;
            SkillEditorGUILayout.LightDivider(new GUILayoutOption[0]);
            GUILayout.Label(SkillEditorContent.FsmControlsLabel, EditorStyles.get_boldLabel(), new GUILayoutOption[0]);
            if (fsm.ExposedEvents.get_Count() + FsmInspector.fsmVariables.get_Count() == 0)
            {
                SkillEditorGUILayout.DisabledLabel(Strings.get_Label_None_In_Table());
            }
            else
            {
                SkillEditorGUILayout.LabelWidth(100f);
                int num = 0;
                for (int i = 0; i < FsmInspector.fsmVariables.get_Count(); i++)
                {
                    SkillVariable fsmVariable = FsmInspector.fsmVariables.get_Item(i);
                    if (fsmVariable.ShowInInspector)
                    {
                        int categoryID = fsmVariable.CategoryID;
                        if (categoryID > 0 && categoryID != num)
                        {
                            num = categoryID;
                            GUILayout.Label(SkillEditor.SelectedFsm.get_Variables().get_Categories()[categoryID], EditorStyles.get_boldLabel(), new GUILayoutOption[0]);
                            SkillEditorGUILayout.LightDivider(new GUILayoutOption[0]);
                        }
                        fsmVariable.DoInspectorGUI(SkillEditorContent.TempContent(fsmVariable.Name, fsmVariable.Name + ((!string.IsNullOrEmpty(fsmVariable.Tooltip)) ? (":\n" + fsmVariable.Tooltip) : "")), false);
                    }
                }
                using (List <SkillEvent> .Enumerator enumerator = fsm.ExposedEvents.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        SkillEvent current = enumerator.get_Current();
                        if (GUILayout.Button(current.get_Name(), new GUILayoutOption[0]))
                        {
                            fsm.Event(current);
                        }
                    }
                }
                if (GUI.get_changed())
                {
                    SkillEditor.RepaintAll();
                }
            }
            if (FsmEditorSettings.ShowHints)
            {
                GUILayout.Box(Strings.get_Hint_Expose_Events_and_Variables(), SkillEditorStyles.HintBox, new GUILayoutOption[0]);
            }
            SkillEditorGUILayout.LightDivider(new GUILayoutOption[0]);
            GUILayout.Label(SkillEditorContent.NetworkSyncLabel, EditorStyles.get_boldLabel(), new GUILayoutOption[0]);
            int num2 = 0;

            SkillBool[] boolVariables = fsm.get_Variables().get_BoolVariables();
            for (int j = 0; j < boolVariables.Length; j++)
            {
                SkillBool fsmBool = boolVariables[j];
                if (fsmBool.get_NetworkSync())
                {
                    GUILayout.Label(fsmBool.get_Name(), new GUILayoutOption[0]);
                    num2++;
                }
            }
            SkillFloat[] floatVariables = fsm.get_Variables().get_FloatVariables();
            for (int k = 0; k < floatVariables.Length; k++)
            {
                SkillFloat fsmFloat = floatVariables[k];
                if (fsmFloat.get_NetworkSync())
                {
                    GUILayout.Label(fsmFloat.get_Name(), new GUILayoutOption[0]);
                    num2++;
                }
            }
            SkillInt[] intVariables = fsm.get_Variables().get_IntVariables();
            for (int l = 0; l < intVariables.Length; l++)
            {
                SkillInt fsmInt = intVariables[l];
                if (fsmInt.get_NetworkSync())
                {
                    GUILayout.Label(fsmInt.get_Name(), new GUILayoutOption[0]);
                    num2++;
                }
            }
            SkillQuaternion[] quaternionVariables = fsm.get_Variables().get_QuaternionVariables();
            for (int m = 0; m < quaternionVariables.Length; m++)
            {
                SkillQuaternion fsmQuaternion = quaternionVariables[m];
                if (fsmQuaternion.get_NetworkSync())
                {
                    GUILayout.Label(fsmQuaternion.get_Name(), new GUILayoutOption[0]);
                    num2++;
                }
            }
            SkillVector3[] vector3Variables = fsm.get_Variables().get_Vector3Variables();
            for (int n = 0; n < vector3Variables.Length; n++)
            {
                SkillVector3 fsmVector = vector3Variables[n];
                if (fsmVector.get_NetworkSync())
                {
                    GUILayout.Label(fsmVector.get_Name(), new GUILayoutOption[0]);
                    num2++;
                }
            }
            if (num2 == 0)
            {
                SkillEditorGUILayout.DisabledLabel(Strings.get_Label_None_In_Table());
            }
            if (FsmEditorSettings.ShowHints)
            {
                GUILayout.Box(Strings.get_Hint_Network_Sync_Variables(), SkillEditorStyles.HintBox, new GUILayoutOption[0]);
            }
            SkillEditorGUILayout.LightDivider(new GUILayoutOption[0]);
            GUILayout.Label("Debug", EditorStyles.get_boldLabel(), new GUILayoutOption[0]);
            fsm.set_ShowStateLabel(GUILayout.Toggle(fsm.get_ShowStateLabel(), SkillEditorContent.ShowStateLabelsLabel, new GUILayoutOption[0]));
            fsm.EnableBreakpoints = GUILayout.Toggle(fsm.EnableBreakpoints, SkillEditorContent.EnableBreakpointsLabel, new GUILayoutOption[0]);
            fsm.EnableDebugFlow   = GUILayout.Toggle(fsm.EnableDebugFlow, SkillEditorContent.EnableDebugFlowLabel, new GUILayoutOption[0]);
            SkillEditorGUILayout.LightDivider(new GUILayoutOption[0]);
            GUILayout.Label("Experimental", EditorStyles.get_boldLabel(), new GUILayoutOption[0]);
            EditorGUILayout.HelpBox(Strings.get_Help_Experimental_Warning(), 0);
            fsm.set_KeepDelayedEventsOnStateExit(GUILayout.Toggle(fsm.get_KeepDelayedEventsOnStateExit(), SkillEditorContent.KeepDelayedEvents, new GUILayoutOption[0]));
            fsm.set_ManualUpdate(GUILayout.Toggle(fsm.get_ManualUpdate(), SkillEditorContent.ManualUpdate, new GUILayoutOption[0]));
            GUILayout.EndScrollView();
            EventType arg_641_0 = Event.get_current().get_type();

            if (EditorGUI.EndChangeCheck())
            {
                SkillEditor.SetFsmDirty(false, false);
            }
            if (Event.get_current().get_type() == null)
            {
                GUIUtility.set_keyboardControl(0);
            }
            SkillEditorGUILayout.LightDivider(new GUILayoutOption[0]);
            EditorGUI.BeginDisabledGroup(true);
            GUILayout.Label("Data Version: " + fsm.get_DataVersion(), EditorStyles.get_miniLabel(), new GUILayoutOption[0]);
            EditorGUI.EndDisabledGroup();
            SkillEditorGUILayout.LockFsmGUI(fsm);
        }
Пример #6
0
    public void Init(int id)
    {
        SkillId = id;

        m_skillData = SkillDataManager.Instance.GetSkillConfigData(SkillId);
        if (m_skillData == null)
        {
            TraceUtil.Log(SystemModel.Common, TraceLevel.Error, "怪物技能:" + SkillId.ToString() + " 不存在");
            TraceUtil.Log(SystemModel.NotFoundInTheDictionary, TraceLevel.Error, "怪物技能:" + SkillId.ToString() + " 不存在");
        }
        int skillActionCount = m_skillData.m_actionId.Length;

        m_skillActionList = new SkillAction[skillActionCount];

        for (int i = 0; i < skillActionCount; i++)
        {
            m_skillActionList[i] = new SkillAction();
            m_skillActionList[i].m_actionData = SkillDataManager.Instance.GetSkillActionData(m_skillData.m_actionId[i]);

            float currentActionDuration = m_skillActionList[i].m_actionData.m_startTime + m_skillActionList[i].m_actionData.m_duration;
            if (m_skillDuration < currentActionDuration)
            {
                m_skillDuration = currentActionDuration;
            }

            //skill action event
            SkillEvent evt = new SkillEvent();
            evt.Type  = SkillEventType.DoAction;
            evt.Param = i;
            evt.EventTimeAfterLaunch = m_skillActionList[i].m_actionData.m_startTime / 1000.0f;
            events.Add(evt);


            //action sfx event
            if (m_skillActionList[i].m_actionData.m_soundEffectName != "0")
            {
                sfxList.Add(m_skillActionList[i].m_actionData.m_soundEffectName);
                SkillEvent sfxEvt = new SkillEvent();
                sfxEvt.Type  = SkillEventType.PlaySoundEffect;
                sfxEvt.Param = sfxList.Count - 1;
                sfxEvt.EventTimeAfterLaunch = m_skillActionList[i].m_actionData.m_startTime / 1000.0f + m_skillActionList[i].m_actionData.m_sfxDelay;
                events.Add(sfxEvt);
            }

            //TODO:effect event
            SkillEvent effectEvt = new SkillEvent();
            effectEvt.Type  = SkillEventType.PlayViewEffect;
            effectEvt.Param = m_skillActionList[i].m_actionData.m_actionId;
            effectEvt.EventTimeAfterLaunch = m_skillActionList[i].m_actionData.m_effect_start_time / 1000.0f;
            events.Add(effectEvt);
        }

        //bullet event
        int bulletCount = m_skillData.m_bulletGroups.Length;

        for (int i = 0; i < bulletCount; i++)
        {
            SkillEvent evt = new SkillEvent();
            evt.Type  = SkillEventType.FireBullet;
            evt.Param = m_skillData.m_bulletGroups[i].m_bulletId;
            evt.EventTimeAfterLaunch = m_skillData.m_bulletGroups[i].m_delay / 1000.0f;
            events.Add(evt);
        }

        //strengthen bullet event
        int strenthenSkillId = m_skillData.FatherSkill == 0? m_skillData.m_skillId : m_skillData.FatherSkill;

        int        bulletCount1 = m_skillData.m_bulletStrengGroups == null?0:m_skillData.m_bulletStrengGroups.Length;
        SSkillInfo?skillInfo    = SkillModel.Instance.GetCurSkill(strenthenSkillId);

        if (m_skillData.SkillStrengthen != 0 && skillInfo != null && skillInfo.Value.byStrengthenLv > 1)
        {
            for (int i = 0; i < bulletCount1; i++)
            {
                SkillEvent evt = new SkillEvent();
                evt.Type  = SkillEventType.FireBullet;
                evt.Param = m_skillData.m_bulletStrengGroups[i].m_bulletId;
                evt.EventTimeAfterLaunch = m_skillData.m_bulletStrengGroups[i].m_delay / 1000.0f;
                events.Add(evt);
            }
        }

        //UI effect Event
        int UIeffectCount = m_skillData.m_UIEffectGroupList.Count;

        for (int i = 0; i < UIeffectCount; i++)
        {
            SkillEvent evt = new SkillEvent();
            evt.Type  = SkillEventType.PlayUIEffect;
            evt.Param = i;
            evt.EventTimeAfterLaunch = m_skillData.m_UIEffectGroupList[i]._EffectStartTime;
            events.Add(evt);
        }

        //convert from ms to s
        m_skillDuration = m_skillDuration / 1000.0f;
        SkillEvent endEvent = new SkillEvent();

        endEvent.EventTimeAfterLaunch = m_skillDuration;
        endEvent.Type  = SkillEventType.SkillOver;
        endEvent.Param = 0;
        events.Add(endEvent);

        //
    }
Пример #7
0
 public SkillEvent OnGuiEditor(SkillEvent se)
 {
     se.DoubleParams0 = EditorGUILayout.DoubleField("时间参数(帧)", se.DoubleParams0);
     return(se);
 }
Пример #8
0
 public void AddSkillEvent(SkillEvent skill)
 {
     toAdd.Add(skill);
 }
Пример #9
0
        private void DoEventEditor()
        {
            if (EditorWindow.get_focusedWindow() != SkillEditor.Window)
            {
                return;
            }
            SkillEditorGUILayout.LabelWidth(86f);
            bool flag = !SkillEvent.IsNullOrEmpty(this.selectedEvent);

            SkillEditorGUILayout.Divider(new GUILayoutOption[0]);
            if (flag && FsmEditorSettings.ShowHints)
            {
                GUILayout.Box(this.selectedEvent.get_IsSystemEvent() ? Strings.get_Hint_System_Events_cannot_be_renamed() : Strings.get_Hint_Use_Event_Browser_to_rename_globally(), SkillEditorStyles.HintBox, new GUILayoutOption[0]);
            }
            if (flag && this.selectedEvent.get_IsGlobal())
            {
                SkillEditorGUILayout.ReadonlyTextField(SkillEditorContent.GlobalEventName, 82f, this.newEventName, new GUILayoutOption[0]);
            }
            else
            {
                if (!flag || !this.selectedEvent.get_IsSystemEvent())
                {
                    EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]);
                    GUILayout.Label(flag ? SkillEditorContent.EditEventNameLabel : SkillEditorContent.AddEventLabel, new GUILayoutOption[]
                    {
                        GUILayout.MaxWidth(80f)
                    });
                    this.newEventName = EditorGUILayout.TextField(this.newEventName, new GUILayoutOption[0]);
                    string text = SkillEditorGUILayout.FsmEventListPopup();
                    if (text != "")
                    {
                        this.AddEvent(text);
                        return;
                    }
                    EditorGUILayout.EndHorizontal();
                    if (!flag && FsmEditorSettings.ShowHints)
                    {
                        GUILayout.Box(Strings.get_Tooltip_EventManager_Add_Event(), SkillEditorStyles.HintBox, new GUILayoutOption[0]);
                    }
                }
            }
            if (flag)
            {
                bool flag2 = false;
                using (List <SkillEvent> .Enumerator enumerator = SkillEditor.SelectedFsm.ExposedEvents.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        SkillEvent current = enumerator.get_Current();
                        if (current.get_Name() == this.selectedEvent.get_Name())
                        {
                            flag2 = true;
                            break;
                        }
                    }
                }
                bool flag3 = EditorGUILayout.Toggle(SkillEditorContent.EventInspectorLabel, flag2, new GUILayoutOption[0]);
                if (flag2 != flag3)
                {
                    if (!flag3)
                    {
                        EditorCommands.RemoveExposedEvent(SkillEditor.SelectedFsm, this.selectedEvent);
                    }
                    else
                    {
                        EditorCommands.AddExposedEvent(SkillEditor.SelectedFsm, this.selectedEvent);
                    }
                    SkillEditor.SetFsmDirty(false, false);
                }
                if (FsmEditorSettings.ShowHints)
                {
                    GUILayout.Box(Strings.get_Hint_EventManager_Expose_Events(), SkillEditorStyles.HintBox, new GUILayoutOption[0]);
                }
            }
            string text2 = this.ValidateEventName(flag);
            bool   flag4 = string.IsNullOrEmpty(text2);

            if (!flag4)
            {
                GUILayout.Box(text2, SkillEditorStyles.ErrorBox, new GUILayoutOption[0]);
            }
            if (Event.get_current().get_isKey())
            {
                if (flag4 && Keyboard.EnterKeyPressed())
                {
                    if (!flag)
                    {
                        this.AddEvent(this.newEventName);
                    }
                    else
                    {
                        this.RenameEvent(this.selectedEvent, this.newEventName);
                    }
                    Event.get_current().Use();
                    GUIUtility.ExitGUI();
                    return;
                }
                if (Event.get_current().get_keyCode() == 27)
                {
                    this.Reset();
                }
            }
        }
        public static SkillEvent EventPopup(GUIContent label, List <SkillEvent> eventList, SkillEvent selectedEvent)
        {
            GUIContent[] eventNamesFromList = Events.GetEventNamesFromList(eventList);
            string       text = (selectedEvent == null) ? null : selectedEvent.get_Name();
            int          num  = -1;
            int          num2 = 0;

            GUIContent[] array = eventNamesFromList;
            for (int i = 0; i < array.Length; i++)
            {
                GUIContent gUIContent = array[i];
                if (gUIContent.get_text() == text)
                {
                    num = num2;
                    break;
                }
                num2++;
            }
            int num3 = EditorGUILayout.Popup(label, num, eventNamesFromList, new GUILayoutOption[0]);

            if (num3 > 0)
            {
                string text2 = eventNamesFromList[num3].get_text();
                using (List <SkillEvent> .Enumerator enumerator = eventList.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        SkillEvent current = enumerator.get_Current();
                        if (current.get_Name() == text2)
                        {
                            return(current);
                        }
                    }
                }
                return(null);
            }
            return(null);
        }
Пример #11
0
 public static bool FsmRespondsToEvent(Skill fsm, SkillEvent fsmEvent)
 {
     return(fsm != null && !SkillEvent.IsNullOrEmpty(fsmEvent) && Events.FsmRespondsToEvent(fsm, fsmEvent.get_Name()));
 }
Пример #12
0
 public static void RemoveExposedEvent(Skill fsm, SkillEvent fsmEvent)
 {
     SkillEditor.RegisterUndo("Set Inspector Flag");
     SkillBuilder.RemoveExposedEvent(fsm, fsmEvent);
     SkillEditor.SetFsmDirty(false, false);
 }
Пример #13
0
        private void genericMenuEditorCallBack(Vector2 v, string cmd)
        {
            if (_currentSkillTimeLineVo == null)
            {
                return;
            }
            int          row     = (int)v.y;
            int          col     = (int)v.x;
            int          toIndex = 0;
            SkillLineVO  lineVo;
            SkillPointVO pointVo;

            switch (cmd)
            {
            case "Remove":
                lineVo = _currentSkillTimeLineVo.lines[row];
                if (lineVo != null)
                {
                    if (EditorUtility.DisplayDialog("Delete", "确定删除?", "确定", "取消"))
                    {
                        _currentSkillTimeLineVo.removeLine(lineVo);
                    }
                }
                break;

            case "Up":
                toIndex = row - 1;
                if (toIndex < 0)
                {
                    return;
                }
                lineVo = _currentSkillTimeLineVo.lines[row];
                if (lineVo != null)
                {
                    _currentSkillTimeLineVo.removeLine(lineVo);
                    _currentSkillTimeLineVo.lines.Insert(toIndex, lineVo);
                }
                break;

            case "Down":
                toIndex = row + 1;
                if (toIndex > _currentSkillTimeLineVo.lines.Count - 1)
                {
                    return;
                }
                lineVo = _currentSkillTimeLineVo.lines[row];
                if (lineVo != null)
                {
                    _currentSkillTimeLineVo.removeLine(lineVo);
                    _currentSkillTimeLineVo.lines.Insert(toIndex, lineVo);
                }
                break;

            case "AddPointer":
                lineVo = _currentSkillTimeLineVo.lines[row];
                if (lineVo != null)
                {
                    lineVo.insert(col, new SkillPointVO());
                    refreashLineVO(lineVo);
                }
                break;

            case "RemovePointer":
                lineVo = _currentSkillTimeLineVo.lines[row];
                if (lineVo != null)
                {
                    pointVo = lineVo.points[col];
                    lineVo.removePoint(pointVo);
                    refreashLineVO(lineVo);
                }
                break;

            case "Copy":
                lineVo = _currentSkillTimeLineVo.lines[row];
                if (lineVo != null)
                {
                    pointVo = lineVo.points[col];
                    if (pointVo != null)
                    {
                        timeLinePointCopy = new ByteArray();
                        timeLinePointCopy.WriteObject(pointVo);
                        timeLinePointCopy.Position = 0;
                    }
                }

                break;

            case "Parse":

                if (timeLinePointCopy != null)
                {
                    timeLinePointCopy.Position = 0;
                }
                SkillPointVO pointVoCopy = null;
                try
                {
                    pointVoCopy = timeLinePointCopy.ReadObject() as SkillPointVO;
                }
                catch (Exception ex)
                {
                    ShowNotification("粘贴数据非事件点数据:" + ex.Message);
                }
                if (pointVoCopy != null)
                {
                    lineVo = _currentSkillTimeLineVo.lines[row];
                    if (lineVo != null)
                    {
                        pointVo = lineVo.points[col];
                        SkillEvent skillEvent = pointVoCopy.evt;
                        if (skillEvent != null)
                        {
                            pointVo.addEvent(skillEvent);
                        }
                    }
                }
                break;
            }
            updateView(_currentSkillTimeLineVo);
        }